Skip to content

Providers phase 4: registry-derived command surfaces - #404

Merged
Juliusolsson05 merged 1 commit into
mainfrom
refactor/providers-phase4-commands
Jul 6, 2026
Merged

Juliusolsson05 merged 1 commit into
mainfrom
refactor/providers-phase4-commands

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Part of #394 (phase 4 — the command-surface rewrite flagged as first-class scope).

  • Generated per-provider split commands (palette) + derived alt-chords (useKeybinds) from a new splitShortcutKey on the identity descriptor. Codex's ids/chords are byte-identical to the old hardcoded ones; a future provider gets palette entries automatically and a chord only if it declares one.
  • Remaining 'Codex' : 'Claude' label ternaries (sessionCommands ×4, DispatchAgentBadge, bulk-switch label fns, prompt-templates) → registry shortLabel.
  • Opportunistic: one more literal-pair guard → isAgentProviderKind.

Not here: the binary switch-direction UI redesign — phase 5, blocked on the explicit-target switch API over the atp neutral-hub codecs.

Verified: tsc both projects, build, vitest 170/170.

🤖 Generated with Claude Code

The command layer was the last hand-enumerated provider surface the
user flagged as first-class scope in #394 (§7):

- paneCommands' hardcoded codex-vertical/codex-horizontal entries
  become GENERATED per-provider split commands: every registered
  agent provider except the DEFAULT_PROVIDER (covered by the generic
  split-vertical/-horizontal) gets "New <Provider> Right/Below"
  palette entries, with an ⌥<key> chord when its identity descriptor
  declares splitShortcutKey. Codex declares 'C', so ⌥C/⌥⇧C and the
  command ids (`codex-vertical` etc.) are byte-identical to before —
  user keybinding overrides keyed on ids survive. A provider without
  a declared key gets palette-only split commands: chords are a
  scarce resource, palette entries aren't.

- useKeybinds' hardcoded alt-c/alt-shift-c block becomes a loop over
  the same descriptors (physical-key e.code matching preserved for
  the macOS alt-letter reason documented in place).

- The remaining shortLabel ternaries (`kind === 'codex' ? 'Codex' :
  'Claude'`) route through the registry: sessionCommands ×4,
  DispatchAgentBadge, bulkProviderSwitch + BulkProviderSwitchModal's
  local providerLabel fns, prompt-templates' agent listing.

- Opportunistic: linked-agent's run() still had a literal-pair guard
  (phase-1 pattern in a shape the sweep missed) → isAgentProviderKind.

NOT here: the switch-direction UI redesign (BulkProviderSwitchModal's
binary source→target model) — that's phase 5, blocked on the
explicit-target switch API over the neutral-hub codecs.

Verified: tsc clean on both projects, electron-vite build clean,
vitest 170/170.

Part of #394.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.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