Skip to content

feat(shortcuts): cycle agents on the new conversation page - #1202

Open
PengXiaoyi wants to merge 3 commits into
spacering-net:mainfrom
PengXiaoyi:feat/cycle-agent-shortcut
Open

PengXiaoyi wants to merge 3 commits into
spacering-net:mainfrom
PengXiaoyi:feat/cycle-agent-shortcut

Conversation

@PengXiaoyi

Copy link
Copy Markdown
Contributor

Summary

Adds a keyboard shortcut to cycle through available agents on the new-conversation page.

  • New cycle_agent shortcut action, default Cmd/Ctrl+Shift+A (remappable in Settings → Shortcuts).
  • Only active on the active tab while it is on the new/welcome page (no persisted conversation).
  • Cycles in the same order as the agent selector, wraps at the end, skips disabled/platform-unavailable agents, and keeps available-but-not-installed agents (matching the picker).
  • Reuses the existing draft agent-switch path (handleAgentSelect); saved conversations stay locked to their agent.

Implementation

  • src/lib/keyboard-shortcuts.ts: registers the cycle_agent action and default.
  • src/hooks/use-cycle-agent-shortcut.ts: panel-scoped keydown hook; ignores key repeat and shortcut-recording state.
  • src/components/conversations/conversation-detail-panel.tsx: enables the hook when isActive && isWelcomeMode.
  • 10 locale files: ShortcutSettings.actions.cycle_agent labels.

Tests

  • pnpm test src/hooks/use-cycle-agent-shortcut.test.ts src/lib/keyboard-shortcuts.test.ts src/i18n/messages.test.ts — 74 tests pass.
  • pnpm lint on changed files.
  • pnpm build passes.

Manual verification

  1. Open a new conversation page and press Cmd/Ctrl+Shift+A; the agent cycles and wraps.
  2. With focus in the composer, the shortcut still cycles and leaves the draft untouched.
  3. After sending the first message, the shortcut no longer changes the agent.
  4. Inactive tabs do not respond.

pengxiaoyi.sean and others added 3 commits November 19, 2026 15:06
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
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