Skip to content

fix(ai): bind Shift+Cmd+I to Focus Chat (was only Ctrl+Cmd+I)#28

Merged
ndemianc merged 1 commit into
developfrom
fix/chat-focus-keybinding
Jul 22, 2026
Merged

fix(ai): bind Shift+Cmd+I to Focus Chat (was only Ctrl+Cmd+I)#28
ndemianc merged 1 commit into
developfrom
fix/chat-focus-keybinding

Conversation

@ndemianc

Copy link
Copy Markdown
Contributor

The bug

Shift+Cmd+I does nothing — the LevelCode AI chat only opens from the Command Palette ("AI: Focus Chat") or Ctrl+Cmd+I.

Why

The command was fine; only its keybinding was wrong. The single contributed binding was ctrl+cmd+i, and Shift+Cmd+I is already claimed in the Code-OSS base by the built-in VS Code chat's "Open Chat (Agent)" action:

// vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts:593
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyI,   // = Shift+Cmd+I on macOS
when: ContextKeyExpr.has(`config.${ChatConfiguration.AgentEnabled}`)

LevelCode ships its own chat and doesn't enable the built-in one, so Shift+Cmd+I fired a dead/stripped action instead of LevelCode's chat.

Fix

An explicit shift+cmd+i → levelcode.ai.focus binding. This reliably wins over the base action because bundled-extension keybindings register at a higher weight than workbench defaults — verified in source, not assumed:

// keybindingService.ts:633-635
weight = KeybindingWeight.BuiltinExtension /*300*/ + idx;   // bundled ext
weight = KeybindingWeight.ExternalExtension /*400*/ + idx;  // external ext
// base chat action is WorkbenchContrib = 200 → the extension binding wins
Platform New chat shortcut
macOS Shift+Cmd+I (what was requested) — mirrors VS Code's own chat
Windows Ctrl+Shift+I
Linux Ctrl+Alt+Shift+I (dodges Dev Tools, same as VS Code's chat does)

The existing Ctrl+Cmd+I is kept as a second binding, so no one loses their current shortcut. This also closes a latent gap: the old "key": "ctrl+cmd+i" used cmd, which is invalid on Windows/Linux — those platforms had no chat shortcut at all.

Verification

  • package.json is valid; the bindings resolve to shift+cmd+i on macOS (+ the cross-platform set).
  • The weight-override mechanism is confirmed in the Code-OSS source.
  • Needs a build smoke-test for the actual keypress — there's no editor host in this environment to press the key. The mechanism is verified; the end-to-end press is not.

🤖 Generated with Claude Code

The chat-focus command worked from the Command Palette but Shift+Cmd+I did
nothing: the only contributed binding was ctrl+cmd+i, and Shift+Cmd+I is claimed
in the Code-OSS base by the built-in VS Code chat's "Open Chat (Agent)" action
(chatActions.ts:593, gated on config.chat.agent.enabled). LevelCode ships its own
chat and doesn't enable that, so the key fired a dead/stripped built-in action
instead of LevelCode's chat.

Added an explicit shift+cmd+i -> levelcode.ai.focus binding. Bundled-extension
keybindings register at weight >= BuiltinExtension (300), above the base action's
WorkbenchContrib (200), so the explicit binding wins (confirmed in
keybindingService.ts:633-635). Mirrors VS Code's own chat convention across
platforms (mac shift+cmd+i, win ctrl+shift+i, linux ctrl+alt+shift+i to dodge Dev
Tools), and keeps the existing ctrl+cmd+i so no one loses their current shortcut.

Also closes a latent gap: the old `"key": "ctrl+cmd+i"` used `cmd`, invalid on
Windows/Linux, so those platforms had no chat shortcut at all.

Verified: package.json is valid and the bindings resolve to shift+cmd+i on mac.
The keypress itself needs a build to smoke-test (no editor host here), but the
weight-override mechanism is confirmed in the Code-OSS source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 03:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes LevelCode AI chat focus keybinding so Shift+Cmd+I works on macOS (and adds sensible defaults for Windows/Linux), preventing the shortcut from triggering the stripped/built-in chat action.

Changes:

  • Add shift+cmd+i (macOS) / ctrl+shift+i (Windows default) / ctrl+alt+shift+i (Linux) keybinding for levelcode.ai.focus.
  • Keep the existing ctrl+cmd+i binding for levelcode.ai.focus as an additional shortcut.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ndemianc
ndemianc merged commit a32e607 into develop Jul 22, 2026
2 checks passed
@ndemianc
ndemianc deleted the fix/chat-focus-keybinding branch July 22, 2026 03:21
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.

2 participants