Skip to content

[feature] ⌘K jumps straight to a folder or a recording - #333

Merged
Lanznx merged 2 commits into
mainfrom
worktree-bridge-cse_01XGaiWyWQ63dfJJexHGwFBk
Sep 5, 2026
Merged

Lanznx merged 2 commits into
mainfrom
worktree-bridge-cse_01XGaiWyWQ63dfJJexHGwFBk

Conversation

@yui0303

@yui0303 yui0303 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

What this changes

⌘K (Ctrl+K on Windows) opens a quick switcher over the main window. One field, one flat ranked list, covering everything you can navigate to at once:

  • personal folders (with the same counts the sidebar shows)
  • Not filed yet / 未分類, Voice typing, Home
  • orgs and their shared folders, when signed in
  • every local recording, matched on its title

move, lands, esc closes; rows are clickable and highlight on hover. An empty query lists the tree rather than nothing, so the palette never opens blank. Each row carries a muted right-hand line saying where it lives — a recording shows its folder, an org folder shows its org — so two similarly named things are tellable apart without opening either.

It never opens over a running meeting, for the same reason the shell hides the tree there.

Why

Reaching a recording meant aiming: pick the right folder in the tree, scan the grid, click the card. Three deliberate acts for something the user could already name in two keystrokes. The library's search box only helps after you have picked the scope it searches, so it can't answer "where did I put that one".

Closes #332. Related to #330 — the other half of the same complaint, that finding one specific meeting means remembering where you filed it.

Notes for review

  • Every row is a place, never an action. on a highlighted row can only navigate — it can't rename, delete, share or start a meeting. A palette that mixes destinations and verbs makes a gamble over a list your finger is already scrolling through. Actions stay on the row and on the card.
  • The ranking is a pure module (src/lib/library/quickSwitch.ts) rather than logic buried in the component, so the ordering is pinned by tests instead of by clicking around. Greedy subsequence scan with word-start / contiguity / prefix / exact bonuses — a folder list is tens of rows, not tens of thousands, and a scorer you can read in one sitting is worth more here than the last few percent of ranking quality. CJK subsequences work (和車 finds 和運租車).
  • Counts come from the same pass the sidebar uses (buildOwnershipIndex + countByNode from lib/library/scope), so a row means the same thing in both places — the invariant [refactor] 方案 C:App Shell — 持久左側欄、History/Settings 收編成路由、公司即資料夾 #195 exists to protect.
  • No new dependency. Built on the radix-ui Dialog primitive already used by ui/sheet.tsx; no ui/dialog.tsx was added since nothing else needs one yet.
  • Org folders are listed from the cache useLibraryTree already holds. Opening the palette warms ensureOrgFolders for the next open; it never blocks on a fetch, so what isn't cached simply isn't listed.

How it was verified

  • bunx tsc --noEmit passes
  • bunx vitest run passes — 29 files, 325 tests
  • Ran the app (bun run tauri dev) and exercised the change
  • Added or updated tests — 18 new cases in src/lib/library/quickSwitch.test.ts
  • Added new user-facing strings to both zh-TW and en in src/i18n/messages.ts

Not yet exercised in a running app — the automated gate is green, but somebody should press ⌘K before this merges.

🤖 Generated with Claude Code

Reaching a recording meant aiming: pick the right folder in the tree, scan
the grid, click the card. Three deliberate acts for something you could
already name. The library's search box only helps after you have picked the
scope it searches, so it can't answer "where did I put that one".

⌘K opens a switcher over the whole tree at once — folders, the fixed nodes,
orgs and their shared folders, and every local recording by title. ↑↓ moves,
↵ lands. Empty query lists the tree, so the palette never opens blank.

Every row is a PLACE, never an action: ↵ on a highlighted row can only
navigate. A palette that mixes destinations and verbs makes ↵ a gamble over a
list your finger is already scrolling.

The ranking is a pure module (lib/library/quickSwitch) rather than logic
inside the component, so the ordering is pinned by tests instead of by
clicking around. Counts come from the same buildOwnershipIndex/countByNode
pass the sidebar uses, so a row means the same thing in both.

Closes #332

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

✅ SonarQube Quality Gate passed — pathorsAI_parley

0 open issues on this PR.

SonarQube typescript:S7778 on the quick switcher: `unassigned` and `voice`
were pushed back to back. One call with both arguments, same order.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Lanznx
Lanznx merged commit b77fff7 into main Sep 5, 2026
4 checks passed
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.

[feature] ⌘K quick switcher: jump straight to a folder or a recording

3 participants