Surface recently-used commands in the Command Palette (⌘K)#57
Open
DragonnZhang wants to merge 3 commits into
Open
Surface recently-used commands in the Command Palette (⌘K)#57DragonnZhang wants to merge 3 commits into
DragonnZhang wants to merge 3 commits into
Conversation
The command palette (⌘K) listed every action grouped by category but kept no memory of what you run — you re-search even for the command you ran seconds ago. Add a "Recently used" group pinned to the top, the standard command-palette convention (VS Code, Raycast, Linear). - Persist the most-recently-run action IDs in localStorage (newest first, de-duplicated, capped at 6) via the shared local-storage helper. - Record each action run from the palette; show the recents in a dedicated "Recently used" group above the categories when the query is empty, and hide it while searching so relevance ranking takes over. - Filter recents to actions that still exist, aren't excluded, and can run right now, so the group never surfaces a stale or dead command. - Extract the ordering into a pure `pushRecent` module with unit tests. - Add the `commands.recent` heading key across all 7 locales. - Add a CDP assertion driving the full lifecycle (seed → render → hide on search → record on run → newest-first on reopen).
Resolve merge conflict in docs/loop/feature-ledger.md (append-only ledger) by keeping the branch's reconciled superset, which already includes the reduce-motion (#51) row. Locale files auto-merged cleanly; i18n parity verified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #56
What & why
OpenWork's command palette (⌘K / Ctrl+K, shipped in #42) lists every registered
action grouped by category but keeps no memory of what you run — you
re-search even for the command you ran seconds ago. Every mature palette (VS
Code ⌘⇧P, Raycast, Linear ⌘K, Claude Code Desktop's command menu) pins a
"Recently used" section to the top so your frequent actions are one
keystroke away. This adds it.
Changes
apps/electron/src/renderer/components/command-palette-recents.ts):a small module storing the most-recently-run action IDs in the renderer's
localStorage(newest first, de-duplicated, capped at 6) via the sharedlib/local-storage.tshelper (one new key,command-palette-recents). Theordering (
pushRecent: dedupe → prepend → cap) is a pure function.CommandPalette.tsx): record each action run fromthe palette; render a "Recently used"
CommandGroupabove the categoriesonly when the query is empty, and hide it while searching so cmdk's
relevance filtering takes over. Recents are filtered to actions that still
exist, aren't excluded, and can run right now (
canExecute) — never a staleor dead row.
commands.recentadded to all 7 locales.command-palette-recents.test.ts(purepushRecent: dedupe,move-to-front, cap, immutability) +
e2e/assertions/command-palette-recents.assert.ts.Frontend-only — no qwen-code backend change, no new IPC, no main-process change.
Verification
bun run typecheck:all— zero delta vsmain(identical error hash/count;the 11 pre-existing
apps/electronerrors are unrelated to this change;packages/sharedandpackages/uiare clean).bun test— zero delta vsmain(56 pre-existing baseline failures onboth
mainand this branch, 0 new); the newpushRecentunit suite is6/6 pass.
bun run electron:build:renderer— ✅ builds cleanly (the renderer bundlecontains the palette change).
rounds): the sandbox's egress policy prevents fetching the Electron binary and
the
libsignalGitHub dependency (WhatsApp worker), soelectron:build:mainand app launch fail here. The assertion is written and self-contained for CI /
reviewer validation.
What the CDP assertion checks (
command-palette-recents.assert.ts)Drives the real built app over CDP in the draft (no-session) state; the palette
reads recents fresh from
localStorageon each open:localStorage['craft-command-palette-recents'] = ['app.toggleTheme'],open the palette → a "Recently used" group renders exactly one row
(
Toggle Theme), above the first category row.sidebar→ the recents group hides (0 recent rows) while filteringstill surfaces a
Toggle Sidebarmatch; clearing the query brings recents back.Toggle Sidebar) from the palette, thenreopen → the recents group now has two rows with
Toggle Sidebarfirst,
Toggle Themesecond — proving the palette persists what you runand orders newest-first.
Generated by Claude Code