✨ Cmd-hold shortcut hints & context-aware ⌘1-9 quick jump#49
Conversation
Show floating pill-shaped badges on actionable sidebar elements when the user holds ⌘ for 300ms. Dismisses on key release, any keystroke, window resign, or app deactivation. Closes #45.
AgentWindowRowView and TaskSidebarView were missing the shortcutHintsVisible passthrough, so tab hints only appeared on non-agent windows in the Workspaces sidebar mode.
…tching ⌘1-9 now selects projects by index (prime shortcut for the most numerous entity). ⌘⌥1-9 selects tabs by global index across all worktrees in the selected project, auto-switching worktree as needed. - Add KeyBindingCategory.projects and 9 project.goto bindings - Add selectProjectByIndex and selectWindowByGlobalIndex to WorkspaceManager - Update sidebar hints: ⌘N on project headers, ⌘⌥N on tab rows - Update test assertions for new binding counts
Both TaskSidebarView and AgentSidebarView now compute global window indices and pass shortcutIndex + shortcutHintsVisible to their window row views, matching the Workspaces sidebar behavior.
⌘1-9 now switches the primary visible item in the current sidebar: - Workspaces: tab (global across all worktrees) - Tasks: worktree (by status group order) - Agents: agent window (by visible order) Removes fixed project/tab bindings in favor of unified quickJump dispatched through WorkspaceManager.quickJump(index:). Each mode shows ⌘N pill hints on its target items when Cmd is held.
Previously globalWindowIndices and selectWindowByGlobalIndex only considered the selected project, so hint pills and shortcuts only worked for the first project's windows. Now iterates all non-collapsed projects in display order.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99100f4c03
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let worktreeWindows = windows | ||
| .filter { $0.worktreeId == worktree.id } |
There was a problem hiding this comment.
Restrict agent hint indexing to agent windows
globalWindowIndices is built from all runtime windows in each worktree, but the Agents sidebar only renders agentWindows. When a worktree has regular terminal tabs before agent tabs, the displayed ⌘1–⌘9 badges are shifted (or missing after the first nine overall windows), so the hint shown on a row no longer matches the row users expect to jump to.
Useful? React with 👍 / 👎.
| let agentWindows = appState.runtimeWindows.filter { | ||
| $0.detectedAgent != nil || $0.agentState != .none | ||
| } |
There was a problem hiding this comment.
Match agent quick-jump order to rendered sidebar order
selectAgentWindowByIndex uses the raw appState.runtimeWindows order, but the Agents sidebar renders in AgentGroupKey.displayOrder (attention, then running, then completed). In mixed-state lists this means ⌘1/⌘2 can select a different agent than the first/second visible rows, breaking the context-aware quick-jump behavior promised by this change.
Useful? React with 👍 / 👎.
| shortcut: Shortcut(key: "[", modifiers: .cmdShift)), | ||
| KeyBinding(id: "tabs.gotoTab1", displayNameKey: "keybinding.tabs.gotoTab1", category: .tabs, | ||
| // Quick Jump (⌘1-9: context-aware, switches primary item in current sidebar mode) | ||
| KeyBinding(id: "quickJump.goto1", displayNameKey: "keybinding.quickJump.goto1", category: .other, |
There was a problem hiding this comment.
Add localized names for quick-jump key bindings
New keybinding display keys (keybinding.quickJump.*) were introduced here, but no corresponding entries were added to en.lproj/zh-Hans.lproj, so the keybinding settings UI will show raw localization keys instead of translated labels. This also violates the repository i18n rule in AGENTS.md requiring new user-facing strings to be added to both locale files.
Useful? React with 👍 / 👎.
…i18n - AgentSidebarView: index only agent windows in group display order (attention → running → completed), skipping collapsed groups - WorkspaceManager: selectAgentWindowByIndex now matches the same group ordering so ⌘1-9 hits the correct visible row - Add keybinding.quickJump.* entries to en + zh-Hans Localizable.strings
Summary
#45
Test plan