Merge lp://qastaging/~uriboni/webbrowser-app/new-tab-wide-format into lp://qastaging/webbrowser-app

Proposed by Ugo Riboni
Status: Merged
Merged at revision: 1128
Proposed branch: lp://qastaging/~uriboni/webbrowser-app/new-tab-wide-format
Merge into: lp://qastaging/webbrowser-app
Diff against target: 1928 lines (+1244/-153)
21 files modified
debian/control (+1/-0)
src/app/webbrowser/Browser.qml (+63/-27)
src/app/webbrowser/DraggableUrlDelegateWide.qml (+98/-0)
src/app/webbrowser/NewTabViewWide.qml (+317/-0)
src/app/webbrowser/UrlDelegateWide.qml (+86/-0)
src/app/webbrowser/bookmarks-folder-model.cpp (+21/-1)
src/app/webbrowser/bookmarks-folder-model.h (+1/-0)
src/app/webbrowser/bookmarks-folderlist-model.cpp (+5/-0)
src/app/webbrowser/bookmarks-folderlist-model.h (+2/-0)
tests/autopilot/webbrowser_app/emulators/browser.py (+77/-4)
tests/autopilot/webbrowser_app/tests/__init__.py (+8/-2)
tests/autopilot/webbrowser_app/tests/test_addressbar_bookmark.py (+2/-6)
tests/autopilot/webbrowser_app/tests/test_bookmark_options.py (+32/-46)
tests/autopilot/webbrowser_app/tests/test_findinpage.py (+1/-2)
tests/autopilot/webbrowser_app/tests/test_new_tab_view.py (+121/-43)
tests/autopilot/webbrowser_app/tests/test_private.py (+8/-13)
tests/autopilot/webbrowser_app/tests/test_tabs.py (+2/-6)
tests/unittests/bookmarks-folder-model/tst_BookmarksFolderModelTests.cpp (+6/-3)
tests/unittests/qml/CMakeLists.txt (+9/-0)
tests/unittests/qml/tst_NewTabViewWide.qml (+372/-0)
tests/unittests/qml/tst_QmlTests.cpp (+12/-0)
To merge this branch: bzr merge lp://qastaging/~uriboni/webbrowser-app/new-tab-wide-format
Reviewer Review Type Date Requested Status
Olivier Tilloy Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+266382@code.qastaging.launchpad.net

Commit message

Implement the widescreen/landscape version of the "new tab" view.
This adds a build dependency on qml-module-qt-labs-settings (for unit tests).

Description of the change

Implement the widescreen/landscape version of the "new tab" view.

It requires the new Sections UITK component which is currently in the staging branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/staging

To post a comment you must log in.
1075. By Ugo Riboni

Merge changes from trunk

1076. By Ugo Riboni

Remove useless import and fix flake8 errors

1077. By Ugo Riboni

Revert changes to UrlDelegate.qml as we are now using a new component instead

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1078. By Ugo Riboni

Fix copyright header

1079. By Ugo Riboni

Revert changes to UrlsList as we are not using it anymore

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1080. By Ugo Riboni

Add qt.labs.settings as build dep

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1081. By Ugo Riboni

Revert previous commit and actually commit the change to the debian dependencies

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

When scrolling the "top sites" view, the first item is drawn on top of the sections header. Either the header should have a higher z-order than the list view, or the list view should be clipped.

The background color of the sections header doesn’t match the visual spec (https://docs.google.com/presentation/d/1ggKmkxUFR5xCBcvkjJ4On9b4iKzEqcycz4hjc16tBGo/edit#slide=id.g2bddb9a1a_038).

In the bookmarks view, when the right panel has active focus the current folder in the left panel should still be highlighted.

In the bookmarks view, the font color for the current bookmark in the right panel shouldn’t be orange.

It seems to be that favicons in the view are too large, and that the font size for delegates is too big as well.

In the visual spec the folders list has a left margin, and folders are separated by horizontal lines.

According to the specification: « User can drag a bookmark in a folder. Bookmarks can only exist in one folder at a time ».

On my vivid desktop, with the UITK staging branch, QmlTests::NewTabLandscapeView::test_switch_sections_by_keyboard() is reliably failing:
  2: FAIL! : QmlTests::NewTabLandscapeView::test_switch_sections_by_keyboard() Compared values are not the same
  2: Actual (): 0
  2: Expected (): 1
  2: Loc: [/home/osomon/dev/phablet/browser/webbrowser-app/tests/unittests/qml/tst_NewTabLandscapeView.qml(191)]

Although not specified, there should probably be scrollbars for all the listviews.

Can you check with design whether we really want all the top sites section to not have a limit? I’d personally add a limit (maybe 10, or 20 top sites max).

Can NewTabLandscapeView be renamed NewTabViewWide?

review: Needs Fixing
1082. By Ugo Riboni

Move the Sections block to the bottom of the view so that list items will not overlap it

1083. By Ugo Riboni

Keep the current folder selected in orange even when the folder list does not have active focus

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
1084. By Ugo Riboni

Rename the components to be called *Wide instead of *Landscape

1085. By Ugo Riboni

Add scrollbars to all lists

1086. By Ugo Riboni

Add a limit of 10 items to the top sites list and unit test it

Revision history for this message
Ugo Riboni (uriboni) wrote :

> When scrolling the "top sites" view, the first item is drawn on top of the
> sections header. Either the header should have a higher z-order than the list
> view, or the list view should be clipped.

Done

> The background color of the sections header doesn’t match the visual spec (htt
> ps://docs.google.com/presentation/d/1ggKmkxUFR5xCBcvkjJ4On9b4iKzEqcycz4hjc16tB
> Go/edit#slide=id.g2bddb9a1a_038).

This and all the other visuals-related comments you made refer to the above linked document, which is the UX spec, not the visual spec. The current design follows the visual spec as closely as possible (minus some changes that will come from the UITK): https://docs.google.com/presentation/d/1woHjO8K4iqyVZZlfQ4BXL0DhYbwkEmZ7wvcUhYzHDRk/edit?pli=1#slide=id.gb81843c7e_0_42

> According to the specification: « User can drag a bookmark in a folder.
> Bookmarks can only exist in one folder at a time ».

I consulted with design and they need to provide some extra UX and visual guidance. They will do so next week but in the meantime I am adding a provisional implementation based on advice I got from James over IRC.

> On my vivid desktop, with the UITK staging branch,
> QmlTests::NewTabLandscapeView::test_switch_sections_by_keyboard() is reliably
> failing:
> 2: FAIL! :
> QmlTests::NewTabLandscapeView::test_switch_sections_by_keyboard() Compared
> values are not the same
> 2: Actual (): 0
> 2: Expected (): 1
> 2: Loc: [/home/osomon/dev/phablet/browser/webbrowser-
> app/tests/unittests/qml/tst_NewTabLandscapeView.qml(191)]

This is caused by a recent change in the UITK staging branch. I submitted a bug to track it: https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1481233

> Although not specified, there should probably be scrollbars for all the
> listviews.

Done

> Can you check with design whether we really want all the top sites section to
> not have a limit? I’d personally add a limit (maybe 10, or 20 top sites max).

James suggested trying with a limit of 10. This is implemented now.

> Can NewTabLandscapeView be renamed NewTabViewWide?

Done

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
1087. By Ugo Riboni

Implement a preliminary version of drag and drop support for reordering bookmarks between folders. Visual and UX design input missing so there are obvious placeholders.

1088. By Ugo Riboni

Merge changes from trunk

1089. By Ugo Riboni

Correctly honor draggable property

Revision history for this message
Olivier Tilloy (osomon) wrote :

Why is there a new "selectedIndexNewTabViewWide" setting? If, as I suspect, this is because the UX spec mandates that the state being retained, then it shouldn’t be a setting. Instead, the StateSaver should be used for that.

Favicons appear to be too large compared to the visual spec (hint: the Favicon component already has a built-in default size, you should probably not change it).

Folder names in bookmarks (left panel) shouldn’t be black when not selected, in the visual spec they appear to be darkGrey.

The spec doesn’t consider the case where a bookmark folder is empty. Can you check with design whether we should display some sort of informative message in this case, or if having an empty right panel is expected?

Can the failing unit test be temporarily skipped (http://doc.qt.io/qt-5/qml-qttest-testcase.html#skip-method) with a reference to bug #1481233 ?

If I swipe a bookmark to the right to delete it, the red delete action covers the left panel.

Bookmark dnd doesn’t seem to work here (I’m not seeing any icon appear when hovering over a bookmark). Might be due to me running a locally-built (and not installed) version of the UITK staging branch.

43 + Binding { target: newTabViewLoader.item; property: "focus"; value: newTabViewLoader.focus }
Is this really needed? A Loader is a FocusScope, so I would expect that always setting focus to true in the component being loaded would be enough to have focus handling just work.

Why was asynchronous loading removed from newTabViewLoader?

There’s now two strings for top sites: "Top Sites" and "Top sites". Can this be made consistent?

In bookmarks-folderlist-model.[h|cpp], I don’t think the count() method is necessary, you can simply define the getter for the count property to be rowCount(). And countChanged() doesn’t appear to ever be emitted, that seems wrong.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

I am now seeing the DND icon when hovering over a bookmark, and I can drag it and drop it in another folder, but this doesn’t appear to actually move it.

review: Needs Fixing
1090. By Ugo Riboni

Fix incorrect item reference that prevented dropping bookmarks to work

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

In debian/control, the build dependency and runtime dependency of webbrowser-app on qtdeclarative5-ubuntu-ui-toolkit-plugin need to specify that they require a version >= 1.3.

review: Needs Fixing
1091. By Ugo Riboni

Use default size for Favicons in delegates

1092. By Ugo Riboni

Adjust folder color to match visual spec

1093. By Ugo Riboni

More fixes on the drag and drop

1094. By Ugo Riboni

Clip the lists to prevent the slide-to-delete element to cover folders

1095. By Ugo Riboni

Remove unnecessary binding for keyboard focus

1096. By Ugo Riboni

Remove async loading on the new tab view loader as it was removed by mistake by original author of the branch

1097. By Ugo Riboni

Fix case of "top sites" string to match the non-widescreen version

1098. By Ugo Riboni

More properly implement the count property of the folder list model

1099. By Ugo Riboni

Rename the settings key used to store the default section to something more clear

1100. By Ugo Riboni

Clip list items instead of lists, so that we can still drag the items without having to reparent them to the outer view

1101. By Ugo Riboni

Fix unit tests broken by previous change

1102. By Ugo Riboni

Skip test that would fail due to UITK bug

1103. By Ugo Riboni

Add a (currently failing) unit test for drag and drop, and fix a mistake in how the drag start event was being emitted

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1104. By Ugo Riboni

Reimplement the drag and drop test as autopilot tests

Revision history for this message
Ugo Riboni (uriboni) wrote :

All other items that are not specifically mentioned here should have been fixed or addressed.

> Why is there a new "selectedIndexNewTabViewWide" setting? If, as I suspect,
> this is because the UX spec mandates that the state being retained, then it
> shouldn’t be a setting. Instead, the StateSaver should be used for that.

It needs a setting because the StateSaver won't save the state when closing the app normally, and we want to remember in which section to open the view by default regardless of how the app was closed.

> The spec doesn’t consider the case where a bookmark folder is empty. Can you
> check with design whether we should display some sort of informative message
> in this case, or if having an empty right panel is expected?

I had already asked some days ago. They are working on it AFAIK.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

If I swipe a bookmark to the right to delete it, hovering over it still displays the grip that allows dragging it to a different folder (partially clipped by the window). I would expect this grip to be disabled/hidden while awaiting confirmation of whether to delete or not.

If I open a new tab, then open the history view (either from the drawer menu or with Ctrl+H), then close it, the sections header’s rendering is busted (the background color is drawn, but not the sections). It appears to be a focus issue, as it fixes itself if I press twice the down arrow key to focus the view again. This doesn’t happen with e.g. the settings view.

As pointed out in an earlier comment, in debian/control, the build dependency and runtime dependency of webbrowser-app on qtdeclarative5-ubuntu-ui-toolkit-plugin need to specify that they require a version >= 1.3.

When running the autopilot tests on my vivid desktop with version 1.3 of the toolkit, I need to modify line 295 of tests/autopilot/webbrowser_app/emulators/browser.py to make the tests pass: s/Icon11/Icon/. I was told by Brendan earlier today that this is a recent change in autopilot, can you apply it in this branch and verify that CI is happy with it?

Even with the above fixed, I’m seeing 3 errors when running the autopilot tests for test_new_tab_view on my desktop:
  webbrowser_app.tests.test_new_tab_view.TestNewTabViewContents.test_open_top_site
  webbrowser_app.tests.test_new_tab_view.TestNewTabViewContents.test_default_home_bookmark
  webbrowser_app.tests.test_new_tab_view.TestNewTabViewContents.test_open_bookmark

review: Needs Fixing
Revision history for this message
Olivier Tilloy (osomon) wrote :

Regarding drag and drop in unit tests: I just did a quick test, modifying test_drag() to do the following:

    function log_item_pos() { console.log("item.pos =", item.x, item.y) }
    log_item_pos()
    item.xChanged.connect(log_item_pos)
    item.yChanged.connect(log_item_pos)
    var c = centerOf(grip)
    mouseDrag(grip, c.x, c.y, -200, 100)

When running it, even though I’m not visualizing the item move, logging proves that it’s actually moving:

    qml: item.pos = 0 56
    qml: item.pos = -11 78
    qml: item.pos = -11 78
    qml: item.pos = -22 133
    qml: item.pos = -22 133
    qml: item.pos = -233 222
    qml: item.pos = -233 222
    qml: item.pos = 0 222
    qml: item.pos = 0 56

1105. By Ugo Riboni

Bump the UITK import version in debian/control

1106. By Ugo Riboni

Hide the dragging grip on bookmarks while the slide-to-delete action in progress

1107. By Ugo Riboni

Move some tests to the non-widescreen class only as the same tests are already implemented as unittests for the widescreen version and would fail in any case

1108. By Ugo Riboni

Fix a problem in how Icons are addressed in AP tests that was making some of them fail when using the uitk 1.3

1109. By Ugo Riboni

Prevent the Sections component to behave erratically when componets from 1.2 are imported while it is displayed. The real fix is to replace all imports to 1.3 but this suffices for now, while the work is being done in another branch.

Revision history for this message
Ugo Riboni (uriboni) wrote :

Fixed unless otherwise noted

> If I open a new tab, then open the history view (either from the drawer menu
> or with Ctrl+H), then close it, the sections header’s rendering is busted (the
> background color is drawn, but not the sections). It appears to be a focus
> issue, as it fixes itself if I press twice the down arrow key to focus the
> view again. This doesn’t happen with e.g. the settings view.

This is caused by the HistoryView importing Ubuntu.Components 1.2
According to the SDK team mixing imports seems to be not supported anymore. I fixed this only in HistoryView for now but the right thing to do would be to bump all imports to 1.3 to avoid other unexpected and hard to debug problems.

> When running the autopilot tests on my vivid desktop with version 1.3 of the
> toolkit, I need to modify line 295 of
> tests/autopilot/webbrowser_app/emulators/browser.py to make the tests pass:
> s/Icon11/Icon/. I was told by Brendan earlier today that this is a recent
> change in autopilot, can you apply it in this branch and verify that CI is
> happy with it?

Let's see what CI says.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1110. By Ugo Riboni

Merge changes from trunk

1111. By Ugo Riboni

Bump import to 2.4 in newly added unit test file

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

The 'inBookmarksView' property should be marked readonly.

Ctrl+Tab works to switch between sections, Tab doesn’t, even though there seems to be code for handling this (is it bug #1481233 ?).

If I cancel a drag (by dropping it somewhere it’s not accepted), it seems the bookmarks list’s interactivity is not restored (I cannot click and drag to move up/down the list).

review: Needs Fixing
1112. By Ugo Riboni

Merge changes from trunk

1113. By Ugo Riboni

Correctly mark a property as readonly

1114. By Ugo Riboni

Fix a bug preventing the interactivity in the boomarks list to be correctly restored at the end of a drag

Revision history for this message
Ugo Riboni (uriboni) wrote :

All fixed and yes, the problem with TAB is caused by bug #1481233

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1115. By Ugo Riboni

More fixes for correctly emitting the end of drag event

1116. By Ugo Riboni

Make it impossible to have keyboard focus within an empty list

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

I’m reliably getting 4 autopilot test failures on my desktop:

webbrowser_app.tests.test_private.TestPrivateView.test_url_showing_in_top_sites_in_and_out_private_mode
webbrowser_app.tests.test_bookmark_options.TestBookmarkOptions.test_save_bookmarked_url_in_new_folder
webbrowser_app.tests.test_bookmark_options.TestBookmarkOptions.test_save_bookmarked_url_in_existing_folder
webbrowser_app.tests.test_bookmark_options.TestBookmarkOptions.test_save_bookmarked_url_in_default_folder

review: Needs Fixing
1117. By Ugo Riboni

Fix some recent AP tests by smoothing away the differences between the wide and narrow new tab views via emulators and helper functions

1118. By Ugo Riboni

Remove method from main window emulator as it does not belong there

1119. By Ugo Riboni

Fix flake8

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Still seeing 3 autopilot failures on desktop:

webbrowser_app.tests.test_bookmark_options.TestBookmarkOptions.test_save_bookmarked_url_in_existing_folder
webbrowser_app.tests.test_new_tab_view.TestNewTabViewContentsWide.test_remove_top_sites
webbrowser_app.tests.test_private.TestPrivateView.test_url_showing_in_top_sites_in_and_out_private_mode

review: Needs Fixing
1120. By Ugo Riboni

Refactor to fix a failing test

1121. By Ugo Riboni

Ensure correct section is always selected, not taking for granted the default

1122. By Ugo Riboni

More fixes for tests in narrow screen mode

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

This looks good now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: