Closed Bug 1656531 Opened 3 years ago Closed 3 years ago

Ctrl+F in Options tab brings up duplicated find bar - should focus options search field instead

Categories

(Thunderbird :: Preferences, defect, P3)

Tracking

(thunderbird_esr68 affected, thunderbird_esr78 fixed, thunderbird80 fixed)

VERIFIED FIXED
81 Branch
Tracking Status
thunderbird_esr68 --- affected
thunderbird_esr78 --- fixed
thunderbird80 --- fixed

People

(Reporter: thomas8, Assigned: khushil324)

References

Details

(Keywords: regression)

Attachments

(2 files, 1 obsolete file)

Seen on 81.0a1 (2020-07-30) (64-bit)

STR

  1. tools > options
  2. press Ctrl+F

Actual

  • duplicated find bar at bottom
  • showing find bar makes little sense for this tab, because options search does the job better

Expected

  • don't show duplicated findbar
  • Ctrl+F to focus options search field instead

Regression window:
https://hg.mozilla.org/comm-central/pushloghtml?fromchange=e8be57e6a6c378331814db495fa864b018c0554c&tochange=67022d52f8ed7b8e270f29f2b774ce5ec236f753
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=3e0cf2f77f07b258e8911ab5fd71a378c46fa1ec&tochange=54ed5eac2abca2519704c74bc5c421b846031504

Suspect:
4a4cb34568406190a3473973622d20e2e2b63607 Geoff Lankow — Bug 1527770 - Convert Thunderbird preferences to use preferencesBindings.js; r=aceman
333fa90d259dc5d99a081b6bd38e9d6fd6157b3d Geoff Lankow — Bug 1527770 - Copy preferences.xml into suite to preserve history; rs=me

Assignee: nobody → khushil324
Priority: -- → P3
Attachment #9169460 - Flags: review?(mkmelin+mozilla)
Status: NEW → ASSIGNED
Comment on attachment 9169460 [details] [diff] [review]
Bug-1656531_focus-search-input-on-ctrl-f-0.patch

Review of attachment 9169460 [details] [diff] [review]:
-----------------------------------------------------------------

::: mail/components/preferences/preferences.js
@@ +144,5 @@
>    document.documentElement.addEventListener("keydown", event => {
>      if (event.keyCode == KeyEvent.DOM_VK_TAB) {
>        categories.setAttribute("keyboard-navigation", "true");
> +    } else if (
> +      (event.altKey || event.metaKey) &&

The shortcut (on non-mac) is Ctrl+F, so the patch doesn't work using altKey.

Can we also use event.code == "F" instead. keyCode is deprected
Attachment #9169460 - Flags: review?(mkmelin+mozilla) → review-

(In reply to Magnus Melin [:mkmelin] from comment #3)

Comment on attachment 9169460 [details] [diff] [review] ⧉[details] [diff] [review]
Bug-1656531_focus-search-input-on-ctrl-f-0.patch

Review of attachment 9169460 [details] [diff] [review] ⧉[details] [diff] [review]:
::: mail/components/preferences/preferences.js
@@ +144,5 @@

document.documentElement.addEventListener("keydown", event => {
if (event.keyCode == KeyEvent.DOM_VK_TAB) {
Can we also use event.code == "F" instead. keyCode is deprected

I think the best current syntax is event.key == "Tab" / event.key == "f" [sic, lowercase!], which we have used for all new listeners in Thunderbird. event.code would be "KeyF", and it's for physical keys on keyboard, not what we want.
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code

To determine what character corresponds with the key event, use the KeyboardEvent.key property instead.

Attachment #9169460 - Attachment is obsolete: true
Attachment #9169616 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9169616 [details] [diff] [review]
Bug-1656531_focus-search-input-on-ctrl-f-1.patch

Review of attachment 9169616 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, thx! r=mkmelin
Attachment #9169616 - Flags: review?(mkmelin+mozilla) → review+
Target Milestone: --- → 81 Branch

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/0cf6798c85fc
Focus options search field with Ctrl+F in Options tab (instead of bringing up duplicated find bar). r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Comment on attachment 9169616 [details] [diff] [review]
Bug-1656531_focus-search-input-on-ctrl-f-1.patch

[Approval Request Comment]
Safe fix for minor issue that would be more visible now that we have the search field in the preferences.

Attachment #9169616 - Flags: approval-comm-esr78?
Attachment #9169616 - Flags: approval-comm-beta?

Comment on attachment 9169616 [details] [diff] [review]
Bug-1656531_focus-search-input-on-ctrl-f-1.patch

[Triage Comment]
Approved for beta
Approved for esr78

Attachment #9169616 - Flags: approval-comm-esr78?
Attachment #9169616 - Flags: approval-comm-esr78+
Attachment #9169616 - Flags: approval-comm-beta?
Attachment #9169616 - Flags: approval-comm-beta+

No duplicated find bar appeared in my testing of TB 80.0b4 on Ubuntu 18.04.4 LTS.

The Preferences tab opened with a blinking bar in the Search field ready to start typing without needing to use any key combinations.

Status: RESOLVED → VERIFIED

(In reply to WaltS48 [:walts48] from comment #12)

No duplicated find bar appeared in my testing of TB 80.0b4 on Ubuntu 18.04.4 LTS.

Try this:

  • switch to 3-pane (ensure focus on folder list)
  • switch back to Options by clicking on Options tab top
  • press Ctrl+F
  • or instead, try cursor-up/down and monitor the 3-pane tab top... (see screencast attachment 9177466 [details] for the account settings equivalent).

Welcome to the world of "background tab focus" in Thunderbird. It's unfortunate that our tabs are technically not as independent as they might appear to be...

Blocks: 1668931
You need to log in before you can comment on or make changes to this bug.