no-bug: Add keyboard shortcuts to move tabs between workspaces#13668
no-bug: Add keyboard shortcuts to move tabs between workspaces#13668kristof-nyr wants to merge 2 commits into
Conversation
Signed-off-by: Kristof Nyari <nyari.kristof66@gmail.com>
Signed-off-by: Kristof Nyari <nyari.kristof66@gmail.com>
| <command id="cmd_zenMoveTabToWorkspace8" /> | ||
| <command id="cmd_zenMoveTabToWorkspace9" /> | ||
| <command id="cmd_zenMoveTabToWorkspace10" /> | ||
| <command id="cmd_zenMoveTabForward" /> |
There was a problem hiding this comment.
Exactly. Missed putting it into the name
| for (let i = 10; i > 0; i--) { | ||
| shortcuts.push( | ||
| new KeyShortcut( | ||
| `zen-move-tab-to-workspace-${i}`, |
There was a problem hiding this comment.
To be honest, I dont think we should have shortcuts to move these to individual spaces, they would clutter up the keyboard shortcuts too much.
There was a problem hiding this comment.
I see your point. My original pain point was that most of the time I use shortcuts for switching between workspaces, and switching between tabs within a workspace (ctrl + [1-9], cmd + [1-9] respectively, on Mac). So when I clicked a link, and it opened the tab in a "wrong" workspace, I'd want to move it to the "correct" one. Since there is already a built-in "Move tab" option, when you right click the tab itself, I thought making a keybind for it would make sense. I also read the issues linked in the description, although those went kind of stale.
If you know any existing way to address my pain point, or propose alternatives, I'm open to collaborate.
Summary
Adds 12 new keyboard shortcuts to move the active (or multiselected) tabs to a specific workspace or to the next/previous workspace.
Addresses community requests in:
What's included
<command>elements inzen-commands.inc.xhtmlshortcutMoveTabTo(index)andmoveActiveTabShortcut(offset)in
ZenSpaceManager.mjs; empty tabs (zen-empty-tab) are filtered out toprevent moving placeholder tabs
[name]") using existing
gZenUIManager.showToast; the toast container's ARIAlive region provides screenreader announcements automatically
ZenKeyboardShortcuts.mjswith migration toversion 19; extracted shared
createMoveTabShortcuts()factory so fresh-installand migration paths cannot diverge
unbound on other platforms
same-workspace guard, empty-tab fallback, and toast verification
Design decisions
When using "change tab(s) to workspace" to send tabs to another workspace it should not switch the workspace #1058 consensus)
pattern)
Behavioral note for reviewers
In
zen-sets.js, thedefaultcase was reordered: workspace-switch andmove-tab commands are now checked before
gZenGlanceManager.handleMainCommandSet().Previously the glance manager saw all default-case commands including workspace
switches. The new order only passes truly unrecognized commands to the glance
manager. This is more correct (workspace commands aren't glance-related) but
reviewers should confirm the glance manager doesn't depend on seeing those events.