Closed Bug 1476844 Opened 6 years ago Closed 6 years ago

In a multi-select context, clear the selection when switching tab via keyboard shortcuts Ctrl-t/Cmd-1

Categories

(Firefox :: Tabbed Browser, defect, P3)

defect

Tracking

()

VERIFIED FIXED
Firefox 63
Tracking Status
firefox63 --- fixed
firefox64 --- verified
firefox65 --- verified

People

(Reporter: ablayelyfondou, Assigned: ablayelyfondou, Mentored)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

When switching tabs with mouse click, selection is cleared. This same behavior should be applied to tab-switch with keyboard shortcuts too.
Assignee: nobody → ablayelyfondou
Comment on attachment 8993984 [details]
Bug 1476844 - Clear selected tabs whenever 'TabSelect' event is fired except when switching tab from 'switchToNextMultiSelectedTab' function in /browser/base/content/tabbrowser.js.

https://reviewboard.mozilla.org/r/258538/#review265570

::: browser/base/content/test/tabs/browser.ini:24
(Diff revision 2)
>  support-files =
>    test_bug1358314.html
>  [browser_isLocalAboutURI.js]
>  [browser_multiselect_tabs_active_tab_selected_by_default.js]
>  [browser_multiselect_tabs_bookmark.js]
> +[browser_multiselect_tabs_clear_selection_when_tab_switch.js]

An oversight from https://reviewboard.mozilla.org/r/255554/diff/2#index_header. None of Gijs and I saw this.
Comment on attachment 8993984 [details]
Bug 1476844 - Clear selected tabs whenever 'TabSelect' event is fired except when switching tab from 'switchToNextMultiSelectedTab' function in /browser/base/content/tabbrowser.js.

https://reviewboard.mozilla.org/r/258542/#review265742

::: browser/base/content/tabbrowser.js:154
(Diff revision 2)
>  
>    _multiSelectedTabsSet: new WeakSet(),
>  
>    _lastMultiSelectedTabRef: null,
>  
> +  _clearMultiSelectionIsLocked: false,

_clearMultiSelectionLocked

::: browser/base/content/tabbrowser.js:3678
(Diff revision 2)
> -    let selectedTabs = ChromeUtils.nondeterministicGetWeakSetKeys(this._multiSelectedTabsSet)
> +      let selectedTabs = ChromeUtils.nondeterministicGetWeakSetKeys(this._multiSelectedTabsSet)
> -                                  .filter(tab => tab.isConnected && !tab.closing);
> +                                    .filter(tab => tab.isConnected && !tab.closing);
> -    let length = selectedTabs.length;
> +      let length = selectedTabs.length;
> -    gBrowser.selectedTab = selectedTabs[length - 1];
> +      gBrowser.selectedTab = selectedTabs[length - 1];
> +    }
> +    this._clearMultiSelectionIsLocked = false;

Can you wrap the above lines in a try/catch and log any exception that gets thrown? Then after the catch you can reset this to false, so we make sure the lock doesn't get stuck to true.
Attachment #8993984 - Flags: review?(jaws) → review+
Comment on attachment 8993984 [details]
Bug 1476844 - Clear selected tabs whenever 'TabSelect' event is fired except when switching tab from 'switchToNextMultiSelectedTab' function in /browser/base/content/tabbrowser.js.

https://reviewboard.mozilla.org/r/258542/#review265742

Patch rebased and updated.
Hey Jared would you like to push this please!
Flags: needinfo?(jaws)
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/697a32f394b2
Clear selected tabs whenever 'TabSelect' event is fired except when switching tab from 'switchToNextMultiSelectedTab' function in /browser/base/content/tabbrowser.js. r=jaws
https://hg.mozilla.org/mozilla-central/rev/697a32f394b2
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Flags: needinfo?(jaws)
I have reproduced this bug with Nightly 63.0a1 (2018-07-18) on Windows 10, 64 Bit!
This bug's fix is verified with latest Nightly!

Build ID 	20180815100249
User Agent 	Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0
QA Whiteboard: [bugday-20180815]
Hello,

Verified fixed in latest nightly 65.0a1(2018-11-08) and latest Beta 64.0b8 on Windows 10x64, macOS 10.13 and Ubuntu 16.04x64 but only for CTRL-t combination of keys. is CTRL-1 disabled?
Flags: needinfo?(jaws)
Using Ctrl-1 through Ctrl-9 should also work to clear the selection. On Mac it would be Cmd-1 through Cmd-9.
Flags: needinfo?(jaws)
Verified fixed with 65.0a1 (2018-11-12)and 64.0b9 on Win 10x64 and macOS 10.13.
I have noticed that the CTRL-1 through CTRL-9 does nothing on the Ubuntu platform. Should I open a separate ticket for this issue?
Flags: needinfo?(jaws)
According to https://searchfox.org/mozilla-central/source/browser/base/content/browser-sets.inc#298, on Ubuntu you will need to use Alt instead of Ctrl. So Alt-1 through Alt-9 should be the equivalent Ubuntu key combinations.
Flags: needinfo?(jaws) → needinfo?(vlad.lucaci)
Confirming the above information from Comment 14. Closing ticket as verified fixed for Ubuntu platform as well.

thank you Jared
Status: RESOLVED → VERIFIED
Flags: needinfo?(vlad.lucaci)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: