Page MenuHomePhabricator

Bug 1806351 - Focusing login filter input with Ctrl+F r=#credential-management-reviewers!
ClosedPublic

Authored by sgalich on Dec 19 2022, 5:33 AM.
Referenced Files
Unknown Object (File)
Thu, May 1, 6:30 AM
Unknown Object (File)
Thu, May 1, 6:30 AM
Unknown Object (File)
Thu, May 1, 6:30 AM
Unknown Object (File)
Thu, Apr 17, 9:17 AM
Unknown Object (File)
Thu, Apr 17, 9:17 AM
Unknown Object (File)
Thu, Apr 17, 9:17 AM
Unknown Object (File)
Wed, Apr 16, 10:10 PM
Unknown Object (File)
Wed, Apr 16, 10:10 PM

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Lint Not Applicable
Unit
Tests Not Applicable
Build Status
Buildable 507512
Build 603870: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".Dec 19 2022, 5:33 AM
phab-bot removed a project: secure-revision.

Code analysis found 1 defect in the diff 660693:

  • 1 defect found by eslint (Mozlint)
IMPORTANT: Found 1 issue (error level) that must be fixed before landing.

You can run this analysis locally with:

  • ./mach lint --warnings --outgoing

If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 660693.

sgalich updated this revision to Diff 674604.
sgalich retitled this revision from WIP: Bug 1806351 - Focusing login filter input with Ctrl+F to Bug 1806351 - Focusing login filter input with Ctrl+F r=#credential-management-reviewers!.

1 issue closed compared to the previous diff 660693.


If you see a problem in this automated review, please report it here.

flod requested changes to this revision.Jan 28 2023, 8:08 PM
flod added inline comments.
browser/locales/en-US/browser/aboutLogins.ftl
10

You need a new ID when making this type of changes
https://mozilla-l10n.github.io/documentation/localization/making_string_changes.html

The new ID should also be namespaced, e.g. about-logins-login-filter.

focusKey is not standard terminology for shortcuts, they're normally called just .key as attributes (and uppercase)

about-logins-login-filter =
  .placeholder = Search Logins
  .key = F
This revision now requires changes to proceed.Jan 28 2023, 8:08 PM
sgalich updated this revision to Diff 674620.
browser/locales/en-US/browser/aboutLogins.ftl
10

It doesn't work with uppercase, because that key is used to match to the event.key on keydown event. I'll keep it lowercase.

browser/locales/en-US/browser/aboutLogins.ftl
3–4

@flod does it make sense to do a follow up patch to rename all legacy names in this file to have about-logins- prefix? Or it will generate unnecessary work elsewhere?

browser/locales/en-US/browser/aboutLogins.ftl
3–4

It will require ~100 locales to retranslate everything. To avoid that you need a migration, which will still duplicate all the strings for new locales until we drop support for ESR 102.

So, no, we shouldn't do that, and just fix strings as we go.

10
flod added inline comments.
browser/locales/en-US/browser/aboutLogins.ftl
10

@Gijs

Do you have any clue about uppercase vs lowercase? I see most of them used in <keyset>.

What concerns me is not much this patch, but more the behavior for users on localized builds if the key ends up uppercase.

browser/locales/en-US/browser/aboutLogins.ftl
10

I believe the answer is https://searchfox.org/mozilla-central/rev/fb1e6d6e5735dcf12d96fde70351aca305961b53/dom/events/KeyEventHandler.cpp#473 - the XUL key event handling code lowercases both incoming events and the access key to normalize, so it doesn't matter there.

Because this is a manual implementation, it would need to manually do the same.

flod requested changes to this revision.Jan 31 2023, 1:36 PM

Thanks @Gijs. We should replicate the same behavior here.

This revision now requires changes to proceed.Jan 31 2023, 1:36 PM
sgalich updated this revision to Diff 678508.
sgalich marked 3 inline comments as done.

Code analysis found 1 defect in the diff 678508:

  • 1 defect found by eslint (Mozlint)
IMPORTANT: Found 1 issue (error level) that must be fixed before landing.

You can run this analysis locally with:

  • ./mach lint --warnings --outgoing

If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 678508.

1 issue closed compared to the previous diff 678508.


If you see a problem in this automated review, please report it here.

dimi added a project: testing-approved.
dimi added a subscriber: dimi.
dimi added inline comments.
browser/components/aboutlogins/tests/browser/browser_loginFilter.js
15

the name might be wrong?

This revision is now accepted and ready to land.Feb 8 2023, 3:25 PM
issammani added a subscriber: issammani.

Thank you for the patch, I have a comment about mac.

browser/components/aboutlogins/content/aboutLogins.mjs
226

On mac, the default would be command + f and not ctrl + f. You can add event.metaKey to the check as well. This will match the command key on mac only as of Firefox 48 since the windows key is not considered meta key anymore. This will however cause both command + f and ctrl + f to work on mac, which I don't mind. The about:addons page excludes this behaviour by explicitly checking the platform https://searchfox.org/mozilla-central/source/toolkit/mozapps/extensions/content/aboutaddons.js#674-680.

This revision now requires changes to proceed.Feb 8 2023, 3:43 PM
browser/components/aboutlogins/content/aboutLogins.mjs
226

You can use event.getModifierState("Accel") to get this to work correctly cross-platform, fwiw.

browser/components/aboutlogins/content/aboutLogins.mjs
226

Thank you both, that is helpful!

browser/components/aboutlogins/tests/browser/browser_loginFilter.js
15

ups, copy/paste failure 😊

sgalich updated this revision to Diff 678759.
sgalich marked 3 inline comments as done.
This revision is now accepted and ready to land.Feb 8 2023, 6:05 PM
This revision is now accepted and ready to land.Feb 8 2023, 9:06 PM

2968 issues closed compared to the previous diff 678799.


If you see a problem in this automated review, please report it here.

This revision is now accepted and ready to land.Feb 13 2023, 10:24 PM