Summary
Ctrl+Tab should activate the next tab in the current workspace pane; Ctrl+Shift+Tab should activate the previous tab. This mirrors the convention in browsers, VS Code, and other tabbed applications.
Proposed implementation
Follows the same pattern as #50 (Ctrl+W):
-
Add ActivateNextTabCommand and ActivatePreviousTabCommand to MainWindowViewModel, each as a no-parameter RelayCommand:
- Find the active workspace pane's document dock.
- Collect
documentDock.VisibleDockables.OfType<WorkspaceDocument>() as an ordered list.
- Find the index of
documentDock.ActiveDockable.
- Advance (or retreat) by one, wrapping around at both ends.
- Call
dockFactory.SetActiveDockable(nextDocument) and dockFactory.SetFocusedDockable(documentDock, nextDocument).
-
Register KeyBindings in MainWindow.axaml:
<Window.KeyBindings>
<KeyBinding Gesture="Ctrl+Tab" Command="{Binding ActivateNextTabCommand}" />
<KeyBinding Gesture="Ctrl+Shift+Tab" Command="{Binding ActivatePreviousTabCommand}" />
</Window.KeyBindings>
Notes
- Both commands are no-ops when the workspace has fewer than two tabs.
- Avalonia window-level
KeyBindings fire after the focused control has had a chance to handle the key, so controls that mark Ctrl+Tab as handled will suppress the binding naturally.
- Cycle order should follow the visual tab strip order (
VisibleDockables index), not MRU order, to be predictable.
Affected files
Phantom.Workspaces/ViewModels/MainWindowViewModel.cs — add ActivateNextTabCommand, ActivatePreviousTabCommand
Phantom.Workspaces/MainWindow.axaml — add KeyBinding entries for Ctrl+Tab and Ctrl+Shift+Tab
Summary
Ctrl+Tabshould activate the next tab in the current workspace pane;Ctrl+Shift+Tabshould activate the previous tab. This mirrors the convention in browsers, VS Code, and other tabbed applications.Proposed implementation
Follows the same pattern as #50 (
Ctrl+W):Add
ActivateNextTabCommandandActivatePreviousTabCommandtoMainWindowViewModel, each as a no-parameterRelayCommand:documentDock.VisibleDockables.OfType<WorkspaceDocument>()as an ordered list.documentDock.ActiveDockable.dockFactory.SetActiveDockable(nextDocument)anddockFactory.SetFocusedDockable(documentDock, nextDocument).Register
KeyBindingsinMainWindow.axaml:Notes
KeyBindings fire after the focused control has had a chance to handle the key, so controls that markCtrl+Tabas handled will suppress the binding naturally.VisibleDockablesindex), not MRU order, to be predictable.Affected files
Phantom.Workspaces/ViewModels/MainWindowViewModel.cs— addActivateNextTabCommand,ActivatePreviousTabCommandPhantom.Workspaces/MainWindow.axaml— addKeyBindingentries forCtrl+TabandCtrl+Shift+Tab