Closed Bug 1467340 Opened 3 years ago Closed 3 years ago

Ctrl+w/Ctrl+f4 should close all selected tabs in a multi-select context

Categories

(Firefox :: Tabbed Browser, defect, P3)

defect

Tracking

()

VERIFIED FIXED
Firefox 62
Tracking Status
firefox62 --- fixed
firefox64 --- verified
firefox65 --- verified

People

(Reporter: ablayelyfondou, Assigned: ablayelyfondou, Mentored)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

A pointed by julie.engel from comment https://bugzilla.mozilla.org/show_bug.cgi?id=1458022#c8:

When one or more tabs are multi-selected (via Ctrl/Cmd or Shift), triggering Ctrl+w/Ctrl+W should close those selected tabs instead of closing the "active" tab.
Summary: Ctrl+w should close all selected tabs in a multi-select context → Ctrl+w/Ctrl+f4 should close all selected tabs in a multi-select context
In addition, Ctrl+f4 should also close all the selected tabs in a multi-select context instead of just closing the current tab.
Assignee: nobody → ablayelyfondou
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Comment on attachment 8984344 [details]
Bug 1467340 - Ctrl+w and Ctrl+f4 shortcuts close all selected tabs in multi-select context.

https://reviewboard.mozilla.org/r/250152/#review256664

::: browser/base/content/test/tabs/browser.ini:49
(Diff revision 1)
>  [browser_bug_1387976_restore_lazy_tab_browser_muted_state.js]
>  [browser_multiselect_tabs_using_Ctrl.js]
>  [browser_multiselect_tabs_using_Shift.js]
>  [browser_multiselect_tabs_close.js]
>  [browser_multiselect_tabs_positional_attrs.js]
> +[browser_multiselect_tabs_close_using_shortcuts.js]

If I understand this right, the tabbrowser code handles the Ctrl+F4 shortcut, which is not enabled on OSX.

Can you update the test to check that the Ctrl+F4 key combination does not close the tab on OSX?

::: browser/base/content/test/tabs/browser_multiselect_tabs_close_using_shortcuts.js:52
(Diff revision 1)
> +// The only difference between this and the task above is the synthesized key
> +add_task(async function using_Ctrl_F4() {

You can combine these two and then put a for-loop inside of it, this would show how they act the same it is just a different key combination.

```js
add_task(async function using_keyboard_shortcuts() {
  for (let key of ["w", "VK_F4"]) {
    ...
  }
});
```
Attachment #8984344 - Flags: review?(jaws) → review-
Comment on attachment 8984344 [details]
Bug 1467340 - Ctrl+w and Ctrl+f4 shortcuts close all selected tabs in multi-select context.

https://reviewboard.mozilla.org/r/250152/#review256664

> If I understand this right, the tabbrowser code handles the Ctrl+F4 shortcut, which is not enabled on OSX.
> 
> Can you update the test to check that the Ctrl+F4 key combination does not close the tab on OSX?

Yes, you're right.
Comment on attachment 8984344 [details]
Bug 1467340 - Ctrl+w and Ctrl+f4 shortcuts close all selected tabs in multi-select context.

https://reviewboard.mozilla.org/r/250152/#review256884

Looks good, thanks! I'll push this to tryserver now and we can land it after the indentation is fixed.

::: browser/base/content/test/tabs/browser_multiselect_tabs_close_using_shortcuts.js:5
(Diff revision 2)
> +const PREF_MULTISELECT_TABS = "browser.tabs.multiselect";
> +const PREF_WARN_ON_CLOSE = "browser.tabs.warnOnCloseOtherTabs";
> +
> +add_task(async function setPref() {
> +    await SpecialPowers.pushPrefEnv({

nit, please use 2-space indentation for this file.
Attachment #8984344 - Flags: review?(jaws) → review+
I think I figured out the issue. On Mac instead of Ctrl+w, we have Cmd+w shorcut for closing a tab. I think using
 1.EventUtils.synthesizeKey(key, { accelKey: true }); 
 2.instead of EventUtils.synthesizeKey(key, { ctrlKey: true });
should fix the problem.


From this link https://www.accessfirefox.org/Firefox_Keyboard_and_Mouse_Shortcuts.html, It seems also Cmd+F4 closes a Tab. 
Please would you like to try it on your mac and tell it's current behavior.
Flags: needinfo?(ablayelyfondou) → needinfo?(jaws)
Cmd+F4 doesn't close the tab for me in my testing.
Flags: needinfo?(jaws)
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ea077199be29
Ctrl+w and Ctrl+f4 shortcuts close all selected tabs in multi-select context. r=jaws
https://hg.mozilla.org/mozilla-central/rev/ea077199be29
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 62
It would be great if we could use all normal options for right clicking tabs.
e.g. reload selected tabs, duplicate selected tabs, pin selected tabs, bookmark selected tabs, close unselected tabs, etc.
And these should be linked to their keyboard shortcuts, e.g. CTRL+D to bookmark tabs, CTRL+R / F5 to reload them.
It may also be worth considering using SHIFT+Click to select range of tabs.
(In reply to qwertyuiopyozo from comment #15)
> It would be great if we could use all normal options for right clicking tabs.
> e.g. reload selected tabs, duplicate selected tabs, pin selected tabs,
> bookmark selected tabs, close unselected tabs, etc.
> And these should be linked to their keyboard shortcuts, e.g. CTRL+D to
> bookmark tabs, CTRL+R / F5 to reload them.
> It may also be worth considering using SHIFT+Click to select range of tabs.

These are planned and have their separate bugs already. Shift-click was implemented by bug 1458013.
Hello guys, 

So I can confirm as verified fixed in latest nightly 65.0a1(2018-11-07) and latest Beta 64.0b7, but only for Windows and Ubuntu. For macOS, only the CMD+W keys work. From reading the above comments, I have seen that Jared encountered the same issue in Comment 12. Is this combination enabled or disabled for the macOS platform?
Flags: needinfo?(jaws)
That combination is disabled for macOS. You can mark as verified fixed.
Flags: needinfo?(jaws)
Confirmed as verified fixed in latest nightly 65.0a1(2018-11-08) and latest Beta 64.0b8 for Windows 10x64, Ubuntu 16.04x64 and macOS 10.13.

Thank you Jared!
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.