Skip to content

Commit ab35690

Browse files
committed
feat: Ctrl/Cmd+Shift+P opens the command palette
Add VS Code's iconic command-palette shortcut (catalog 5.6 parity polish). The palette was opened only by Ctrl/Cmd+K; Ctrl+Shift+P fell through to the Ctrl+P files branch. - CommandPalette.tsx: a new first keydown case (ctrl/meta + shift + p) opens commands, before the Ctrl+P files case, so Ctrl+Shift+P no longer opens files. Ctrl+K still opens commands (its case is unchanged) - App.tsx show-commands: keybinding metadata 'Ctrl+K' -> 'Ctrl+Shift+P' (the VS Code standard, now shown in the Keyboard Shortcuts reference and the conflict detector); Ctrl+K keeps working via the listener (the Ctrl+K e2es still pass) - a new e2e presses Ctrl+Shift+P and asserts the palette opens in command mode; the keyboard-shortcuts e2e still reports no conflicts - the adversarial review caught two doc-consistency ripples (the slice-133 lesson), both fixed: the welcome 'Learn the keys' tip (lib/welcome.ts) and specs/QUICK_OPEN.md still advertised Ctrl+K -> both now lead with Ctrl/Cmd+Shift+P (Ctrl+K legacy alias) - HONESTY: the 5.6 palette row is already Done; this is parity polish on a Done row, so there is NO matrix count/status change. TOTAL unchanged 129/102/97
1 parent 86da799 commit ab35690

7 files changed

Lines changed: 48 additions & 10 deletions

File tree

PROGRESS.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,27 @@ accessibility help, git remotes, problems filter, output channels, editor font,
2424
diff change counter, terminal exit code, workspace symbols, open editors,
2525
git stash manager, theme export, auto-reveal, narration log.
2626

27+
## Slice 141: Ctrl/Cmd+Shift+P opens the command palette (done; Done-row parity polish)
28+
29+
Add VS Code's iconic command-palette shortcut. The palette was opened by Ctrl/Cmd+K only; Ctrl+Shift+P
30+
(which every VS Code user reaches for) fell through to the Ctrl+P files branch.
31+
32+
- CommandPalette.tsx keydown listener: a new first case (ctrl/meta + shift + p) -> toggleTo('commands'),
33+
placed before the Ctrl+P files case so Ctrl+Shift+P no longer opens files. Ctrl+K still opens commands.
34+
- App.tsx show-commands command: keybinding metadata 'Ctrl+K' -> 'Ctrl+Shift+P' (the VS Code-standard,
35+
now shown in the Keyboard Shortcuts reference and known to the conflict detector); Ctrl+K keeps working
36+
via the listener (the e2es that press Ctrl+K still pass).
37+
- Quality: typecheck, lint clean; the keyboard-shortcuts conflict e2e still reports no conflicts (Ctrl+Shift+P
38+
is unique); a new e2e presses Ctrl+Shift+P and asserts the palette opens in COMMAND mode (the
39+
'type a command' placeholder, distinguishing it from the Ctrl+P files mode). build + full e2e pass.
40+
- HONESTY: the command-palette row (5.6) is already Done; this is parity POLISH on a Done row (adds the
41+
standard shortcut), so there is NO matrix count/status change. Evidence updated in the two palette rows
42+
and the 5.6 prose. TOTAL unchanged 129/102/97.
43+
- Review: 2 minors, both the consistency ripple of changing the advertised shortcut (the slice-133 lesson):
44+
the welcome "Learn the keys" tip (lib/welcome.ts) still showed Ctrl/Cmd+K -> updated to Ctrl/Cmd+Shift+P;
45+
and specs/QUICK_OPEN.md (cited by the 5.6 prose) still documented Ctrl+K -> updated to lead with
46+
Ctrl/Cmd+Shift+P (Ctrl/Cmd+K legacy alias). Both fixed.
47+
2748
## Slice 140: restore sidebar visibility and the open panel across a reload (done; honest no-flip)
2849

2950
Extend layout-state persistence (catalog 5.5) so a reload restores the primary sidebar visibility and

apps/desktop/e2e/app.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,16 @@ test.describe('vsclaude shell', () => {
220220
await expect(page.getByText('No build task found in this folder.')).toBeVisible();
221221
});
222222

223+
test('Ctrl+Shift+P opens the command palette in command mode', async ({ page }) => {
224+
await page.goto('/');
225+
await page.getByText('Claude Code, in motion').click();
226+
await page.keyboard.press('Control+Shift+KeyP');
227+
const palette = page.getByRole('dialog', { name: /command palette/i });
228+
await expect(palette).toBeVisible();
229+
// The command-mode placeholder confirms it opened commands (not the Ctrl+P files mode).
230+
await expect(palette.getByPlaceholder(/type a command/i)).toBeVisible();
231+
});
232+
223233
test('the active file is restored after a reload', async ({ page }) => {
224234
await page.goto('/');
225235
// The default open file is login-form.tsx; open a different one (exact avoids session.config.ts).

apps/desktop/src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,8 @@ export function App() {
706706
id: 'show-commands',
707707
title: 'Show All Commands',
708708
keywords: ['command', 'palette'],
709-
keybinding: 'Ctrl+K',
709+
// VS Code's command-palette shortcut; Ctrl/Cmd+K also opens it (legacy alias).
710+
keybinding: 'Ctrl+Shift+P',
710711
run: () => openPalette('commands'),
711712
});
712713
r.register({

apps/desktop/src/components/CommandPalette.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ export function CommandPalette({
113113
useEffect(() => {
114114
const onKey = (e: KeyboardEvent) => {
115115
const key = e.key.toLowerCase();
116-
if ((e.ctrlKey || e.metaKey) && key === 'k') {
116+
if ((e.ctrlKey || e.metaKey) && e.shiftKey && key === 'p') {
117+
// Ctrl/Cmd+Shift+P opens the command palette (VS Code's command-palette shortcut).
118+
e.preventDefault();
119+
toggleTo('commands');
120+
} else if ((e.ctrlKey || e.metaKey) && key === 'k') {
117121
e.preventDefault();
118122
toggleTo('commands');
119123
} else if ((e.ctrlKey || e.metaKey) && key === 'p') {

apps/desktop/src/lib/welcome.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface WelcomeTip {
1010

1111
export const WELCOME_TIPS: readonly WelcomeTip[] = [
1212
{ keys: 'Ctrl/Cmd+P', text: 'Quickly open any file by name.' },
13-
{ keys: 'Ctrl/Cmd+K', text: 'Run any command from the palette.' },
13+
{ keys: 'Ctrl/Cmd+Shift+P', text: 'Run any command from the palette.' },
1414
{ keys: 'Ctrl/Cmd+Shift+F', text: 'Search across the whole project.' },
1515
{ keys: 'Ctrl/Cmd+Shift+G', text: 'Stage and commit from Source Control.' },
1616
{ keys: 'Ctrl/Cmd+,', text: 'Open Settings to tune the editor.' },

specs/FEATURE_MATRIX.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,18 @@ vsclaude uses a fixed, presentation-mode-driven layout rather than the dockable
178178
| Reset layout to defaults | Done | View: Reset Layout restores the default presentation mode, closes the bottom drawer, exits zen mode, shows the primary sidebar (undoing Ctrl+B), and resets the sidebar width and bottom-panel height to their defaults. An e2e widens then hides the sidebar, runs the command, and asserts it is visible at the default width. | (View locations are fixed positions, so there is nothing to relocate to reset.) |
179179
| Show/hide individual views independently | Partial | The primary sidebar toggles with Ctrl/Cmd+B and the bottom panel with Ctrl/Cmd+J (View: Toggle Panel, restoring the last panel); both layout toggles are e2e covered. Problems, Search, and Source Control also toggle from the activity bar, and Output and Outline from their View commands. | The right-side companion and timeline panels and the terminal footer are still mode-coupled, not independently toggleable. |
180180
| Focused / zen editor expansion | Partial | Minimal mode shows only center editor. | No per-panel maximize button or transition animation. |
181-
| Command palette (fuzzy search, run commands) | Done | CommandPalette.tsx (Ctrl/Cmd+K, fuzzy, arrows, Enter); CommandRegistry ranks; commands in App.tsx. | |
181+
| Command palette (fuzzy search, run commands) | Done | CommandPalette.tsx (Ctrl/Cmd+Shift+P, and Ctrl/Cmd+K as a legacy alias, fuzzy, arrows, Enter); CommandRegistry ranks; commands in App.tsx. | |
182182
| Search/replace functionality | Partial | Quick-open ships: Ctrl/Cmd+P file open, : go-to-line, and the > command route (CommandPalette.tsx, see 5.6). Monaco's in-file find is on by default. | Project-wide search and replace across files (5.8), and @ or # symbol search, are still missing. |
183183
| Breadcrumbs / path navigation | Done | Breadcrumbs.tsx renders the active file's folders and name above the editor (breadcrumbSegments, root-relative); the file segment opens the document symbol picker, and each folder segment opens a dropdown of that folder's contents (folderChildren over the demo files or the flattened workspace tree; crumbFolderPath resolves the menu into the entry namespace so it works in both the demo and a real absolute-path workspace; all unit tested) where a file opens it and a subfolder drills in. The menu closes on outside-click or Escape. An e2e jumps to a sibling file. | |
184184
| Keyboard shortcuts and customization | Missing | CommandPalette.tsx and WorkspaceEditor.tsx hardcode keys; no rebinding. | No keybindings.json, editor, or shortcut help view. |
185185

186186
## 5.6 Quick open and command palette
187187

188-
The palette is now unified: Ctrl or Cmd plus K opens command mode and Ctrl or Cmd plus P opens file quick-open over a real recursive index, and the input routes live on a prefix (`>` commands, `:` go to line and column). Commands can advertise a keybinding, and a reusable quick-pick framework (filterQuickPick plus the prefix router) backs it all. Go to Symbol (@) now lists the active file's outline inline and jumps to the chosen symbol, with the editor's full Go to Symbol one row away. Workspace symbols (#), command categories, and go-to-definition navigation are still partial, with the deeper code-intelligence work deferred. See specs/QUICK_OPEN.md.
188+
The palette is now unified: Ctrl or Cmd plus Shift plus P (or Ctrl or Cmd plus K) opens command mode and Ctrl or Cmd plus P opens file quick-open over a real recursive index, and the input routes live on a prefix (`>` commands, `:` go to line and column). Commands can advertise a keybinding, and a reusable quick-pick framework (filterQuickPick plus the prefix router) backs it all. Go to Symbol (@) now lists the active file's outline inline and jumps to the chosen symbol, with the editor's full Go to Symbol one row away. Workspace symbols (#), command categories, and go-to-definition navigation are still partial, with the deeper code-intelligence work deferred. See specs/QUICK_OPEN.md.
189189

190190
| Capability | Status | Evidence | What is missing |
191191
| --- | --- | --- | --- |
192-
| Command palette (fuzzy, keywords, Ctrl/Cmd+K) | Done | CommandPalette.tsx fuzzy search via registry.fuzzyFind(); command-registry.ts subsequence scoring and keywords; arrow/Enter nav. | |
192+
| Command palette (fuzzy, keywords, Ctrl/Cmd+Shift+P) | Done | CommandPalette.tsx fuzzy search via registry.fuzzyFind(), opened by Ctrl/Cmd+Shift+P (Ctrl/Cmd+K legacy alias); command-registry.ts subsequence scoring and keywords; arrow/Enter nav. | |
193193
| Recently-used command/project ordering | Done | App.tsx registers Open Recent from ws.recents; recents.ts RecentProject with timestamps and de-dup; useWorkspace.ts exposes recents. | |
194194
| Quick open files by name with Ctrl+P | Done | CommandPalette.tsx file mode on Ctrl/Cmd+P; useFileIndex.ts walks roots via fs.walk (IPC v4, fs_ops.rs fs_walk); demo files used when no workspace; e2e covers it. | |
195195
| Symbol navigation in current file with @ | Done | Typing @ in the palette lists the active file's outline symbols inline (outlineSymbols over markdown headings, JSON top-level keys, CSS selectors, YAML top-level keys, TOML tables, and top-level JS/TS/Rust declarations) and jumps to the chosen symbol's line; a trailing row hands off to the editor's full Go to Symbol (Monaco quickOutline) for nested symbols and other languages. parsePaletteInput symbols mode and outlineSymbols are unit tested; an e2e jumps to a symbol. | |

specs/QUICK_OPEN.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ In scope for this slice:
2323
returns the file paths under a folder, skipping heavy or noise directories and
2424
capping the result so a huge tree never hangs the picker. This bumps the IPC
2525
protocol to version 4.
26-
- A unified palette in the desktop app that opens on Ctrl or Cmd plus K in command
27-
mode and Ctrl or Cmd plus P in file mode, and routes live on the typed prefix:
26+
- A unified palette in the desktop app that opens on Ctrl or Cmd plus Shift plus P (or
27+
the Ctrl or Cmd plus K legacy alias) in command mode and Ctrl or Cmd plus P in file
28+
mode, and routes live on the typed prefix:
2829
`>` for commands, `:` for go to line and column, and no prefix for the mode it
2930
was opened in.
3031
- Keybinding display: commands may carry a `keybinding` label that the palette
@@ -81,8 +82,9 @@ a display label only; it does not register a real key handler.
8182
4. Ctrl or Cmd plus P opens the palette in file mode with the file index loaded
8283
for the open workspace, or the demo files when no workspace is open. Typing
8384
filters; Enter opens the highlighted file in the editor.
84-
5. Ctrl or Cmd plus K still opens command mode with the existing label and
85-
placeholder, so the current palette flow and its end-to-end test keep passing.
85+
5. Ctrl or Cmd plus Shift plus P (and the Ctrl or Cmd plus K legacy alias) opens command
86+
mode with the existing label and placeholder, so the current palette flow and its
87+
end-to-end test keep passing.
8688
Typing `>` in file mode switches to commands, and `:` switches to go-to-line.
8789
6. With a file open, choosing `:40` reveals and selects line 40 in the active
8890
editor and focuses it.

0 commit comments

Comments
 (0)