Merge lp://qastaging/~uriboni/webbrowser-app/find-in-page into lp://qastaging/webbrowser-app

Proposed by Ugo Riboni
Status: Rejected
Rejected by: Olivier Tilloy
Proposed branch: lp://qastaging/~uriboni/webbrowser-app/find-in-page
Merge into: lp://qastaging/webbrowser-app
Diff against target: 647 lines (+351/-51)
9 files modified
debian/control (+2/-2)
src/app/actions/FindInPage.qml (+27/-0)
src/app/webbrowser/AddressBar.qml (+63/-22)
src/app/webbrowser/Browser.qml (+23/-6)
src/app/webbrowser/Chrome.qml (+71/-21)
tests/autopilot/webbrowser_app/emulators/browser.py (+11/-0)
tests/autopilot/webbrowser_app/tests/http_server.py (+5/-0)
tests/autopilot/webbrowser_app/tests/test_findinpage.py (+134/-0)
tests/unittests/qml/tst_AddressBar.qml (+15/-0)
To merge this branch: bzr merge lp://qastaging/~uriboni/webbrowser-app/find-in-page
Reviewer Review Type Date Requested Status
Olivier Tilloy Disapprove
Riccardo Padovani (community) Needs Fixing
PS Jenkins bot continuous-integration Needs Fixing
Ugo Riboni (community) Approve
Review via email: mp+258225@code.qastaging.launchpad.net

Commit message

Implement the "Find in Page" feature.
This bumps the runtime dependency on liboxideqt-qmlplugin to 1.8.

Description of the change

Implement the Find in Page feature in the browser UI according to the UX spec.

The only difference from the spec is the fact that results counter comes before the clear button. This is because the UI Toolkit component TextField does not support adding components after the clear button.

Needs this oxide branch to work: https://code.launchpad.net/~uriboni/oxide/find-in-page/+merge/258184

To post a comment you must log in.
Revision history for this message
Olivier Tilloy (osomon) wrote :

Haven’t done a proper review yet, but here’s one preliminary remark: you’ll need to bump the dependency on liboxideqt-qmlplugin to >= 1.8 in debian/control, for webbrowser-app and qtdeclarative5-ubuntu-web-plugin.

review: Needs Fixing
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 :

Thanks for working on this. I did a first quick round of testing review, here are a few comments, in no particular order:

The flake8 unit test is failing.

The label of findInPageCounter should be i18n’d, with a proper TRANSLATORS comment.
As a consequence, autopilot tests shouldn’t rely on the value of that label. Can we somehow expose the values of current and count as properties of the label, for testing purposes?

It appears findInPageMode is never assigned a default value. Not sure whether javascript (and its QML implementation) specifies that booleans are false by default, but it would be cautious to have it default to false.

87 + value: textField.text.length > 1 ? textField.text : ""
  Shouldn’t the above be [textField.text.length > 0] ? Or is it intentional that searching doesn’t start for one single character? I can’t open the UX spec right now, if this is intentional would you mind adding a comment to explain the rationale?

« This is because the UI Toolkit component TextField does not support adding components after the clear button »
  Can you raise that with design (James Mulholland and the UITK team, to ensure they are aware of the issue?

The size of ChromeButton instances in Chrome.qml has been updated at revision 997, can you please update the new instances too?

In the autopilot emulator for the chrome, the new buttons could use a more explicit naming scheme, e.g. "find_next_button()" and "find_prev_button()".

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

Fixed everything except the following:

> The label of findInPageCounter should be i18n’d, with a proper TRANSLATORS
> comment.
> As a consequence, autopilot tests shouldn’t rely on the value of that label.
> Can we somehow expose the values of current and count as properties of the
> label, for testing purposes?

I disagree with this. In my opinion numbers are not language specific and the "/" is just a random separator.
Who is going to translate a slash ?

> It appears findInPageMode is never assigned a default value. Not sure whether
> javascript (and its QML implementation) specifies that booleans are false by
> default, but it would be cautious to have it default to false.

Variables are not initialized in JS and an uninitialized variable when interpreted in boolean context has a false value, but I have fixed this for clarity.

> « This is because the UI Toolkit component TextField does not support adding
> components after the clear button »
> Can you raise that with design (James Mulholland and the UITK team, to
> ensure they are aware of the issue?

I spoke with Rae who spoke with James who said for now it is ok to do it the way we do it, and they will see with the UI Toolkit people if this can be changed in the future.

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

Thanks for the changes, they look good.

> I disagree with this. In my opinion numbers are not language specific
> and the "/" is just a random separator.
> Who is going to translate a slash ?

That’s an opinion, not an informed decision. The "n/m" formatting might look awkward is some languages, or maybe even completely meaningless. Can you check that this formatting is ok for all languages listed at https://en.wikipedia.org/wiki/List_of_language_names ? If you can’t, then the string should be i18n’d.

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

Looks good and fixes the issue

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

> Looks good and fixes the issue

Please ignore, commented on the wrong MR

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

Update to match renaming of webview.findInPage to findController

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 :

There are a couple of conflicts when merging this branch into the latest trunk, can you please resolve them?

In AddressBar.qml, can the following three new properties be marked readonly?
  findInPagePattern
  current
  count

review: Needs Fixing
1002. By Ugo Riboni

Merge changes from trunk

1003. By Ugo Riboni

Reorder context menu items to match browser spec more closely

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 AddressBar.qml, can the following three new properties be marked
> readonly?
> findInPagePattern
> current
> count

searchSuggestions.active should be false when chrome.findInPageMode is true.

Is the removal of the 200 response code in HTTPRequestHandler.do_GET for "/suggest" intentional?

In test_activation(), after leaving the find in page mode, can you also check that the contents of the address bar are restored? Also I think the focus should be unset on the address bar when leaving this mode (and this should be tested too). The internal.resetFocus() function in Browser.qml probably is what you want to use.

review: Needs Fixing
1004. By Ugo Riboni

Merge changes from trunk

1005. By Ugo Riboni

Fix mistake in previous merge from trunk

1006. By Ugo Riboni

Ensure that focus is restored to the webview when we exit find in page mode, and that suggestions are hidden when we enter find in page mode

1007. By Ugo Riboni

Ensure that the address bar text gets back to its correct simplified status when exiting find in page mode

1008. By Ugo Riboni

Add tests for the previous changes

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

Merge translations from trunk

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 :

When running the unit tests in verbose mode, I’m seeing the following warning:

    QWARN : QmlTests::AddressBar::test_exitingFindInPageRestoresUrl() file://…/src/app/webbrowser/AddressBar.qml:58:15: Unable to assign [undefined] to bool

This could easily be addressed by setting findController to a mock in the unit test.

Since UbuntuWebView02.qml imports oxide 1.8, the runtime dependency of qtdeclarative5-ubuntu-web-plugin on liboxideqt-qmlplugin needs to be bumped to 1.8 in debian/control.

In AddressBar.qml:
 - I don’t think the changes to the 'visible' property of the favicon and the 'name' property of the Icon with id 'action' are useful, given that the parent item is invisible when findInPageMode is true.
 - In the findInPageCounter Label, instead of #5d5d5d, use UbuntuColors.darkGrey for the color.

In Browser.qml:
 - The 'findinpage' action should be enabled only if !chrome.findInPageMode.

review: Needs Fixing
1010. By Ugo Riboni

Remove find in page conditional code for a few things that would be hidden anyway in that mode

1011. By Ugo Riboni

Use an ubuntu color for the counter

1012. By Ugo Riboni

Enable the find in page action only when not already in that mode

1013. By Ugo Riboni

Quiet warnings by using a mock for AddressBar.findController in qml unit tests

1014. By Ugo Riboni

Bump dependency on oxide to 1.8

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 not convinced the change to src/Ubuntu/Web/UbuntuWebView02.qml is needed (I don’t see why it should be, and reverting it doesn’t seem to break the functionality, at least when run locally on my desktop). There’s nothing in the UbuntuWebView component that requires oxide 1.8, it’s only the browser that makes use of it that requires access to the findController API. The import statement in AddressBar.qml should probably be bumped though. Even though not strictly needed for the code to be parsed and interpreted by the QML engine, it’s assuming the findController object is there.

When launching the app locally I’m seeing the following message printed twice before anything else in the console:

    QString::arg: Argument missing: "" , 0

Could you look into what’s causing it to be printed?

1015. By Ugo Riboni

Bump the version of oxide only where needed

1016. By Ugo Riboni

Simplify code and remove a warning

1017. By Ugo Riboni

Revert change to debian to bump dependency on oxide 1.8 in the browser component

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

That looks good now, thanks!

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

Note: I approved but I’m holding off the top-approval until oxide 1.8 (which this MR has a hard dependency on) is released.

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)
1018. By Ugo Riboni

Merge changes from trunk

1019. By Ugo Riboni

Leave find in page mode when toggling private browsing on and off

1020. By Ugo Riboni

Enter and Shift+Enter navigate through search results

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Great feature!
Some comments:
- it's impossible now to enter an address and press enter to navigate (search in page intercept the enter key?)
- I expect CTRL+F to use the search
- How could I esc the search mode? ESC button doesn't work, and clicking the back arrow is a bad UX IMO
- I see it's by design you don't trigger the search if only one character is in the textfield, but it's a bit confusing IMO, because all other browsers highlights only one char, so the first time I entered a char I expect it to be evidenced: if nothing is highlighted, I think there isn't any occurrence of that char in the page

Other than that, looks awesome to me, thanks :-)

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

There are now conflicts when merging this branch into the latest trunk.

Additionally the QML unit tests are failing with errors like this:

    AddressBar.qml:247: TypeError: Property 'next' of object QObject_QML_32(0x2e540a0) is not a function

And as pointed out by Riccardo, validating a URL in the address bar with Enter doesn’t work any longer, and Ctrl+F should activate the find in page mode.

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

Unmerged revisions

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: