Skip to content

✨ Cmd-hold shortcut hints & context-aware ⌘1-9 quick jump#49

Merged
vaayne merged 7 commits intomainfrom
feature/cmd-hold-shortcut-hints
Apr 5, 2026
Merged

✨ Cmd-hold shortcut hints & context-aware ⌘1-9 quick jump#49
vaayne merged 7 commits intomainfrom
feature/cmd-hold-shortcut-hints

Conversation

@vaayne
Copy link
Copy Markdown
Owner

@vaayne vaayne commented Apr 5, 2026

Summary

  • Add Cmd-hold shortcut hint pills on sidebar UI (300ms intentional delay, pill badge style)
  • Redesign ⌘1-9 to be context-aware by sidebar mode: Workspaces → tabs, Tasks → worktrees, Agents → agent windows
  • Fix ⌘1-9 quick jump and hint pills to work across all projects (not just selected project) in Workspaces mode

#45

Test plan

  • Hold Cmd for 300ms in each sidebar mode — verify hint pills appear on all visible items
  • Press ⌘1-9 in Workspaces mode with multiple projects — verify navigation works across projects
  • Press ⌘1-9 in Tasks mode — verify worktree switching by status order
  • Press ⌘1-9 in Agents mode — verify agent window switching
  • Collapse a project, verify its windows are excluded from numbering
  • All 1101 test assertions pass

vaayne added 6 commits April 5, 2026 00:00
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.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +66 to +67
let worktreeWindows = windows
.filter { $0.worktreeId == worktree.id }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread Sources/Mori/App/WorkspaceManager.swift Outdated
Comment on lines +2146 to +2148
let agentWindows = appState.runtimeWindows.filter {
$0.detectedAgent != nil || $0.agentState != .none
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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
@vaayne vaayne merged commit c6dfc67 into main Apr 5, 2026
5 checks passed
@vaayne vaayne deleted the feature/cmd-hold-shortcut-hints branch April 5, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant