Merge lp:~uriboni/webbrowser-app/topsite-previews into lp:webbrowser-app
| Status: | Merged |
|---|---|
| Approved by: | Olivier Tilloy on 2015-10-13 |
| Approved revision: | 1204 |
| Merged at revision: | 1228 |
| Proposed branch: | lp:~uriboni/webbrowser-app/topsite-previews |
| Merge into: | lp:webbrowser-app |
| Diff against target: |
1917 lines (+957/-198) 25 files modified
src/app/webbrowser/Browser.qml (+37/-29) src/app/webbrowser/BrowserTab.qml (+23/-19) src/app/webbrowser/CMakeLists.txt (+1/-1) src/app/webbrowser/HistoryModel.qml (+0/-24) src/app/webbrowser/HistoryView.qml (+12/-4) src/app/webbrowser/HistoryViewWide.qml (+19/-10) src/app/webbrowser/NewTabView.qml (+55/-18) src/app/webbrowser/NewTabViewWide.qml (+15/-28) src/app/webbrowser/PreviewManager.qml (+91/-0) src/app/webbrowser/SettingsPage.qml (+2/-3) src/app/webbrowser/UrlPreviewDelegate.qml (+123/-0) src/app/webbrowser/UrlPreviewGrid.qml (+90/-0) src/app/webbrowser/file-operations.cpp (+7/-0) src/app/webbrowser/file-operations.h (+3/-0) src/app/webbrowser/qmldir (+1/-0) src/app/webbrowser/webbrowser-app.cpp (+8/-1) tests/autopilot/webbrowser_app/emulators/browser.py (+41/-8) tests/autopilot/webbrowser_app/tests/__init__.py (+12/-6) tests/autopilot/webbrowser_app/tests/test_new_tab_view.py (+5/-6) tests/autopilot/webbrowser_app/tests/test_site_previews.py (+168/-0) tests/unittests/qml/tst_BrowserTab.qml (+64/-1) tests/unittests/qml/tst_HistoryViewWide.qml (+12/-6) tests/unittests/qml/tst_NewTabViewWide.qml (+27/-32) tests/unittests/qml/tst_PreviewManager.qml (+117/-0) tests/unittests/qml/tst_QmlTests.cpp (+24/-2) |
| To merge this branch: | bzr merge lp:~uriboni/webbrowser-app/topsite-previews |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Olivier Tilloy | 2015-09-01 | Approve on 2015-10-13 | |
| PS Jenkins bot | continuous-integration | Needs Fixing on 2015-10-12 | |
|
Review via email:
|
|||
Commit Message
Reimplement the top sites list to use a grid of previews in all form factors.
Description of the Change
Reimplement the top sites list to use a grid of previews in all form factors.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1160
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1160
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Olivier Tilloy (osomon) wrote : | # |
Please revert the changes to po/webbrowser-
Additionally, this branch has conflicts when merging into the latest trunk. Can you please resolve them?
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1162
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1162
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1169
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1170
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1162
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1172
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1172
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1176
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1177
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1178
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1180
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Olivier Tilloy (osomon) wrote : | # |
A first incomplete round of (mostly) functional review, with comments in no particular order:
In UrlPreviewDeleg
When launching the app, I’m seeing the following error in the console:
src/app/
When opening a new tab, I’m seeing the following error in the console:
src/app/
I don’t think this is a bug introduced by your changes, rather an issue that’s always been there, but it is now more visible: initially, the captures for my top sites grid are blank (expected). If from there I click on one top site to open it, wait for the page to load, then close the tab, and open a new tab again, there is no capture for the page that I just viewed. This is because a capture is not made when closing a tab (only when switching tabs). Not sure how much work this would require to implement, but worth taking a look anyway.
On a related note, can captures be removed when closing tabs? I thought this was implemented already, but it doesn’t seem to work.
The captures in the grid view look very blurry, is this because of downscaling, and if so can we do something to improve it?
In narrow mode, when dragging the grid view upwards, it overlaps with the list of bookmarks above. It needs to be clipped.
The context menu that appears on grid items when long-pressing/
Not a big deal as (AFAIK) keyboard navigation was never implemented in narrow views, but since the grid view handles it correctly, can the narrow new tab view be fixed to fully support keyboard nav? If it would require too many changes, I’m fine with leaving it for another branch.
| Olivier Tilloy (osomon) wrote : | # |
I expressed a concern about app startup performance for the branch where you made the bookmarks model a singleton, and this holds true for the changes done to the history model in this branch. Probably even more so, because the history model is likely to grow substantially over time. Please do some profiling to confirm/invalidate.
In BrowserTab.qml, there are extraneous semi-colons at line ends in JS code, please remove them for consistency.
| Olivier Tilloy (osomon) wrote : | # |
There used to be a good reason for making the name of the preview file a unique ID as opposed to a hash of the URL, but at the moment I fail to remember that good reason. The relevant revision is http://
| Olivier Tilloy (osomon) wrote : | # |
I think I remember now why using a hash of the URl wasn’t a good idea: if in a given tab I browse to n different URLs (either by entering a new address or by clicking on links), and if in between each new navigation I switch to another tab and back, this is going to generate n different previews, which are not deleted until the next time the browser is started. The preview cache can easily grow big with unused previews that way, and this is not desirable on devices with a limited amount of storage.
Could the PreviewManager be made more flexible by accepting any string identifier instead of a URL? Previews for top sites could use the corresponding URL, while previews for tabs would use the tab’s unique ID.
| Olivier Tilloy (osomon) wrote : | # |
In BrowserTab.qml, 'topSites' and 'cachedPreviewU
In HistoryViewWide
In NewTabView.qml, the comment to explain why there is a negative right margin makes sense, but instead of hardcoding it, couldn’t it be bound to "-contentColumn
In UrlPreviewGrid.qml, do you really need to implement keyboard navigation yourself? I thought GridView already implemented it.
PreviewManager.qml should import Ubuntu.Web 0.2, as it has a reference to cacheLocation.
src/app/
In tests/autopilot
In test_cleanup_
In tst_BrowserTab.qml, is the additional import of Ubuntu.Test really needed?
3 out of the 4 tests in webbrowser_
| Ugo Riboni (uriboni) wrote : | # |
> A first incomplete round of (mostly) functional review, with comments in no
> particular order:
Fixed unless noted below:
> In UrlPreviewDeleg
> which has been fixed in the UITK, so the hack can now be cleaned up. Same in
> test_new_
We still can't use the CPO's method to click on an action because of another bug.
We can however get the action button by objectName, so I fixed that at least.
> I don’t think this is a bug introduced by your changes, rather an issue that’s
> always been there, but it is now more visible: initially, the captures for my
> top sites grid are blank (expected). If from there IÂ click on one top site to
> open it, wait for the page to load, then close the tab, and open a new tab
> again, there is no capture for the page that IÂ just viewed. This is because a
> capture is not made when closing a tab (only when switching tabs). Not sure
> how much work this would require to implement, but worth taking a look anyway.
The other case when the preview is not captured is when we navigate somewhere else, and while we might be able to delay the unloading of the tab, I don't know if we can't easily delay navigating away on a link click.
This idea of delaying hiding the tab is also making me a bit nervous anyway. Would it be too expensive CPU-wise to periodically call grabToImage without saving to disk, and saving to disk only when the tab stops being visible or the URL changes ?
> On a related note, can captures be removed when closing tabs? IÂ thought this
> was implemented already, but it doesn’t seem to work.
It is implemented and I tested it again and it works here.
Can you give me steps to reproduce this problem ?
Please keep in mind that when closing a tab, if the site is in the top sites its preview will not be deleted.
> The context menu that appears on grid items when long-pressing/
> can be dismissed when clicked outside, but the click is propagated to
> whatever’s underneath, so if I click anywhere to dismiss the menu I might
> activate a top site.
This sounds like a bug in the ActionSelection
I will investigate more and file a bug.
> Not a big deal as (AFAIK) keyboard navigation was never implemented in narrow
> views, but since the grid view handles it correctly, can the narrow new tab
> view be fixed to fully support keyboard nav? If it would require too many
> changes, I’m fine with leaving it for another branch.
The real problem with the narrow mode version is that it uses a Column+Repeater setup. I plan to convert that into a proper ListView to get better performance, and keyboard navigation will work almost "for free" after that.
So let's keep it for that other MR.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1185
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Ugo Riboni (uriboni) wrote : | # |
> In UrlPreviewGrid.qml, do you really need to implement keyboard navigation
> yourself? I thought GridView already implemented it.
What it does not implement is telling me when we are on item zero and pressing LEFT or when we are on any item on row zero and pressing UP. In these cases we need to signal that we want to give up focus so that it can go back to the address bar.
But the handlers for DOWN and RIGHT were indeed redundant so I removed them.
> PreviewManager.qml should import Ubuntu.Web 0.2, as it has a reference to
> cacheLocation.
I guess the reason why this worked anyway was that the context object exported by the Ubuntu.Web plugin is attached the first time the plugin is imported, and then accessible globally since all QML files in webbrowser-app share the same context.
I personally think that we should re-think our usage of context properties and context objects. They make things harder to unit test, since there does not seem to be a way to set up the same environment (with mocks replacing the original context properties) while setting up a unit test. Wouldn't it be better if instead the plugins would export their globals as part of explicit singletons, which can then easily be extended and/or replaced while unit testing ?
Referencing cacheLocation or globals.
Anyway, fixed here, but we should discuss this.
> In test_cleanup_
> can we be sure that 0.5 seconds is enough?
We really can't. Like all tests that are checking that something does *not* happen, we have to either make a guess, or just decide that we can't test this particular feature.
I am happy to take your guess over mine, if you want to suggest a different value, or have a more rationally explainable value to propose.
> 3 out of the 4 tests in webbrowser_
> mode because they silently assume wide mode (in narrow mode, before calling
> self.open_
In the process of fixing this
| Olivier Tilloy (osomon) wrote : | # |
In narrow mode, the highlight for top site previews is cut off on the left hand side for the leftmost column.
Also, keyboard navigation with arrows doesn’t ensure that the currently highlighted preview is visible (if e.g. the last row is out of sight and I navigate down to it with the down arrow key, it should come into view).
| Olivier Tilloy (osomon) wrote : | # |
I can reliably reproduce the following issue:
- ensure that webbrowser-app is not running
- rm $HOME/.
- launch webbrowser-app, open a new tab, verify that there are no captures
- open each top site in a new tab, and ensure that they all have a capture displayed
- close all tabs, when the last tab is closed, the app quits
- verify that you have (at least) 10 captures in $HOME/.
- launch webbrowser-app again, and open a new tab
- the captures are gone, for some (wrong) reason they’ve been purged from the cache
| Olivier Tilloy (osomon) wrote : | # |
Revision 1195 fixes the issue indeed, but is a bit convoluted. Given that the session restore code is already itself triggered by a Timer with a 1msec interval to ensure it’s out of the critical startup path, maybe the databasePath of the history model could be set in that same timer’s onTriggered (after restoring the open tabs). That would avoid the need for a 'sessionRestore
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1194
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Ugo Riboni (uriboni) wrote : | # |
> Revision 1195 fixes the issue indeed, but is a bit convoluted. Given that the
> session restore code is already itself triggered by a Timer with a 1msec
> interval to ensure it’s out of the critical startup path, maybe the
> databasePath of the history model could be set in that same timer’s
> onTriggered (after restoring the open tabs). That would avoid the need for a
> 'sessionRestore
> initialCaptures
I fixed this but we still need getOpenPages because the open tabs are a combination of restored tabs and initialTabs (which I think come from the command line)
| Ugo Riboni (uriboni) wrote : | # |
> In narrow mode, the highlight for top site previews is cut off on the left
> hand side for the leftmost column.
Was due to clipping. Fixed.
> Also, keyboard navigation with arrows doesn’t ensure that the currently
> highlighted preview is visible (if e.g. the last row is out of sight and I
> navigate down to it with the down arrow key, it should come into view).
The issue here is that we are using a flickable around the GridView, and the GridView height equals its contentHeight, so as far as the GridView is concerned there is nothing to scroll.
I will fix this when adding full support for keyboard nav to the narrow view list (and replacing columns+repeaters with listviews) in a separate MR.
| Olivier Tilloy (osomon) wrote : | # |
> I will fix this when adding full support for keyboard nav to the narrow view
> list (and replacing columns+repeaters with listviews) in a separate MR.
Okay.
| Olivier Tilloy (osomon) wrote : | # |
A couple of minor comments, we’re definitely getting there!
- Given that internal.
- The interactive property of the grid view in narrow mode should be set to false, otherwise if I start flicking on the grid only the grid moves, whereas I would expect the entire page to move.
I haven’t tested on a device yet (to ensure no functional regressions in narrow mode on touch), will do when CI generates packages for the latest revision.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1195
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1201
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Olivier Tilloy (osomon) wrote : | # |
Testing on arale, and I can confirm that the fact that the gridview is flickable inside the containing flickable is annoying, if IÂ scroll all the way down I cannot scroll back up to see the list of bookmarks.
I’m also seeing that the capture images are vertically centered inside the ubuntu shape, which sometimes makes it hard to identify a page by its capture. An extreme example is http://
I would expect the captures to be top-aligned, I think it’s generally easier to recognize a page when seeing its topmost part.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1203
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Olivier Tilloy (osomon) wrote : | # |
webbrowser_

FAILED: Continuous integration, rev:1159 jenkins. qa.ubuntu. com/job/ webbrowser- app-ci/ 2150/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 3929 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- amd64-ci/ 904 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- armhf-ci/ 904 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- armhf-ci/ 904/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- i386-ci/ 904 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- vivid-mako/ 3215 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 3926 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 3926/artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 22955
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/webbrowser- app-ci/ 2150/rebuild
http://