Bug 2276 - Replace custom HobNoteBook with gtk.Notebook
Summary: Replace custom HobNoteBook with gtk.Notebook
Status: VERIFIED FIXED
Alias: None
Product: Hob
Classification: Build System, Metadata & Runtime
Component: hob (show other bugs)
Version: 1.3
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.3
Assignee: Joshua Lock - Disabled
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-04-10 18:22 UTC by Joshua Lock - Disabled
Modified: 2012-05-25 09:40 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments
Screenshot demonstrating a gtk.Notebook with badge and search entry (11.71 KB, image/png)
2012-04-10 18:23 UTC, Joshua Lock - Disabled
no flags Details
Code implementing the prototype displayed in the screenshot. (3.01 KB, text/x-python)
2012-04-10 18:24 UTC, Joshua Lock - Disabled
no flags Details
Current implementation (72.42 KB, image/png)
2012-04-13 00:09 UTC, Joshua Lock - Disabled
no flags Details
Fixed version (69.85 KB, image/png)
2012-04-13 17:05 UTC, Joshua Lock - Disabled
no flags Details
Showing the non-selected state (97.21 KB, image/png)
2012-04-13 17:06 UTC, Joshua Lock - Disabled
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Lock - Disabled 2012-04-10 18:22:04 UTC
The HobNoteBook code is a complex custom widget which adds maintenance overhead without buying us much.

It was originally developed as gtk.Notebook was presumed lacking in API to meet the visual design, specifically the badges on a tab displaying an appropriate count/number and the search entry in-line with the tabs.

The first can be addressed through gtk.Notebook's API to include a widget inside the tab. We can develop a custom widget which acts as the badge and then a container subclass with a label and badge child can be set as the tabs widget.

The second is easily addressed using the gtk.Notebook.set_action_widget() API.
Comment 1 Joshua Lock - Disabled 2012-04-10 18:23:43 UTC
Created attachment 456 [details]
Screenshot demonstrating a gtk.Notebook with badge and search entry
Comment 2 Joshua Lock - Disabled 2012-04-10 18:24:59 UTC
Created attachment 457 [details]
Code implementing the prototype displayed in the screenshot.

This short piece of code prototypes a badge widget and inline search entry using the standard gtk.Notebook.
Comment 3 Joshua Lock - Disabled 2012-04-10 18:27:43 UTC
Add Belen and Shane to CC: I think we should make this change before 1.2 release as it improves the consistency of the application with the rest of the users OS and further reduces the amount of custom complex code we need to maintain and bugfix in 1.2.
Comment 4 Joshua Lock - Disabled 2012-04-10 18:51:11 UTC
The implementation of the HobTabBar and HobNotebook classes which provide the custom API are ~430LOC (including whitespace).

I believe strongly that replacing this large set of custom code with much smaller widget subclasses (less than 100LOC based on the attached prototype) and using the standard toolkit API will increase the maintainability of the code base and reduce the amount of potential bugs (when using the trusted method of inferring bug count by LOC).

The severity of this issue is debatable and something I'd want design input on.

The integration of the classes developed for the prototype into Hob would likely be 2D work so this change would be cutting it rather fine for 1.2.
Comment 5 Joshua Lock - Disabled 2012-04-10 20:32:39 UTC
Estimate 2D work for this. This should mean patch submission by EOD Thurs.
Comment 6 Jessica 2012-04-11 14:06:14 UTC
Sync with Shane and the consensus of the triage team is to have this fix in for 1.2 base on Josh's comments
Comment 7 Joshua Lock - Disabled 2012-04-13 00:09:31 UTC
Created attachment 465 [details]
Current implementation
Comment 8 Joshua Lock - Disabled 2012-04-13 17:05:29 UTC
Created attachment 470 [details]
Fixed version

Here's a screenshot showing implementation with the boxes composited out. This is good to go!
Comment 9 Joshua Lock - Disabled 2012-04-13 17:06:20 UTC
Created attachment 471 [details]
Showing the non-selected state
Comment 10 Joshua Lock - Disabled 2012-04-13 19:22:59 UTC
I've just realised that the API the patch relies on is too new for CentOS 6.

It seems unlikely the patch can be merged at this point?
Comment 11 Belen Barros Pena 2012-04-16 10:40:18 UTC
Joshua: this is excellent work. If it doesn't make for 1.2 I hope we can get it in for 1.3

Just a few (very small comments):

1.  Increase the width of the search text field. Now that we have space, we should use it

2. I would take out the blue line in the selected tab. It seems to me the selected state is strong enough visually to do without it. If you feel you need to reinforce the selected state, we could use a higher font weight for the tab label (a little bolder).

3. Reinforce the table headings: they tend to blend with the table content. Increasing the font size slightly, increasing the heading height and some extra top margin to clearly separate them from the bottom of the tabs would probably help.

4. Recipe name column: this column has a different background colour. That seems unnecessary and undermines the zebra style, which tries to reinforce the visual relationship between content in the same row across different columns

5. Increasing slightly the height of the rows would give the table text some space and probably make it a bit easier to read

6. The search field 'clear' icon should only appear once there is something to clear (i.e. when I have typed a search query)

7. In the screenshot showing the Tasks tab selected, the tab label is enclosed in a blue box. I am not sure why this is.

I am listing the above mainly for documentation purposes. Hopefully we'll have a visual designer for 1.3 work that will provide specifics to help implementation.

Belen
Comment 12 Joshua Lock - Disabled 2012-04-16 18:08:34 UTC
I just wanted to explain why some of the raised details are that way.

(In reply to comment #11)
> 2. I would take out the blue line in the selected tab. It seems to me the
> selected state is strong enough visually to do without it. If you feel you need
> to reinforce the selected state, we could use a higher font weight for the tab
> label (a little bolder).

That's because It's the active row, I'd clicked it (and shown the persistent tooltip). We can remove highlighting of the selected/active row.

> 4. Recipe name column: this column has a different background colour. That
> seems unnecessary and undermines the zebra style, which tries to reinforce the
> visual relationship between content in the same row across different columns

This is to indicate that it's the active, sorted, column. If I click one of the other column headers to sort the table by that column it will have the different background colour.

> 7. In the screenshot showing the Tasks tab selected, the tab label is enclosed
> in a blue box. I am not sure why this is.

This is to indicate that widget has focus. This is useful if I'm using a keyboard, or other input device, to move focus.
Comment 13 Belen Barros Pena 2012-04-17 08:48:21 UTC
(In reply to comment #12)
> I just wanted to explain why some of the raised details are that way.
> 
> (In reply to comment #11)
> > 2. I would take out the blue line in the selected tab. It seems to me the
> > selected state is strong enough visually to do without it. If you feel you need
> > to reinforce the selected state, we could use a higher font weight for the tab
> > label (a little bolder).
> 
> That's because It's the active row, I'd clicked it (and shown the persistent
> tooltip). We can remove highlighting of the selected/active row.

Sorry: I didn't mean the row, but the active tab (Included). It has a blue line along the top which I guess tries to indicate it is the active tab. Maybe it is brought in by the theme.

> 
> > 4. Recipe name column: this column has a different background colour. That
> > seems unnecessary and undermines the zebra style, which tries to reinforce the
> > visual relationship between content in the same row across different columns
> 
> This is to indicate that it's the active, sorted, column. If I click one of the
> other column headers to sort the table by that column it will have the
> different background colour.

I suspected so, but it is the wrong approach to indicate the selected column for sorting. Using another cell colour dilutes the zebra approach in the table and creates visual noise. We are better off using the column heading. Currently an arrow indicates the selected sorted heading: we could reinforce it with a different visual style in the heading font.

> 
> > 7. In the screenshot showing the Tasks tab selected, the tab label is enclosed
> > in a blue box. I am not sure why this is.
> 
> This is to indicate that widget has focus. This is useful if I'm using a
> keyboard, or other input device, to move focus.

Understood. Thanks!
Comment 14 Joshua Lock - Disabled 2012-04-17 14:59:04 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > I just wanted to explain why some of the raised details are that way.
> > 
> > (In reply to comment #11)
> > > 2. I would take out the blue line in the selected tab. It seems to me the
> > > selected state is strong enough visually to do without it. If you feel you need
> > > to reinforce the selected state, we could use a higher font weight for the tab
> > > label (a little bolder).
> > 
> > That's because It's the active row, I'd clicked it (and shown the persistent
> > tooltip). We can remove highlighting of the selected/active row.
> 
> Sorry: I didn't mean the row, but the active tab (Included). It has a blue line
> along the top which I guess tries to indicate it is the active tab. Maybe it is
> brought in by the theme.

Ah, yes. That's the theme's indication of the active tab.
Comment 16 Belen Barros Pena 2012-05-25 09:40:21 UTC
Looking nice :)