Conversation
…ecursive folder search
There was a problem hiding this comment.
🟡 Changes recommended
The quick find handler arms auto-promotion unconditionally, which can leak the one-shot flag into later manually opened searches when no LIVE run occurs to claim it (e.g., empty jump buffer).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a “quick find” workflow to the desktop app’s main window that escalates the pane’s type-to-jump buffer into a recursive search rooted at the focused pane’s current folder, then auto-promotes the first live batch into a snapshot/results pane (and adjusts navigation so users can get back out cleanly).
Changes:
- Introduces
search.quickFindcommand that pre-fills Search with the pane’s jump buffer and auto-runs/promotes results into the main pane. - Adds a one-shot auto-promote arm/consume mechanism and a
SearchDialogeffect that promotes the first LIVE batch through the existing “Show all in main window” path. - Updates navigation (“parent” on snapshot panes walks Back), UI hinting for type-to-jump, i18n keys across locales, and adds unit/E2E coverage.
File summaries
| File | Description |
|---|---|
| scripts/check/checks/macos-availability-selectors.json | Refreshes committed selector availability index metadata used by the macOS availability checker. |
| apps/desktop/test/e2e-playwright/type-to-jump.spec.ts | Adds E2E coverage asserting quick find promotes into a search-results pane. |
| apps/desktop/src/routes/(main)/explorer-api.ts | Extends ExplorerAPI with takeJumpBuffer() for quick find. |
| apps/desktop/src/routes/(main)/command-handlers/app-dialog-handlers.ts | Adds search.quickFind handler (prefill + arm + open dialog). |
| apps/desktop/src/routes/(main)/command-dispatch.test-harness.ts | Updates explorer spy to include takeJumpBuffer. |
| apps/desktop/src/routes/(main)/command-dispatch.characterization.test.ts | Updates dispatchable command count to include the new command. |
| apps/desktop/src/lib/search/snapshot-promotion.ts | Adds one-shot armAutoPromote / takeAutoPromote flag for quick find auto-promotion. |
| apps/desktop/src/lib/search/SearchDialog.svelte | Consumes auto-promote arm on the first LIVE run and auto-promotes on first batch. |
| apps/desktop/src/lib/search/SearchDialog.auto-promote.svelte.test.ts | Adds dialog-level tests for auto-promotion claim/consume behavior. |
| apps/desktop/src/lib/search/DETAILS.md | Documents the quick find flow and its load-bearing constraints. |
| apps/desktop/src/lib/search/auto-promote.test.ts | Adds unit tests for the one-shot arm semantics. |
| apps/desktop/src/lib/intl/messages/zh/fileExplorer.json | Adds type-to-jump quick find hint translation key (zh). |
| apps/desktop/src/lib/intl/messages/zh/commands.json | Adds commands.searchQuickFind.label translation key (zh). |
| apps/desktop/src/lib/intl/messages/zh-Hant/fileExplorer.json | Adds type-to-jump quick find hint translation key (zh-Hant). |
| apps/desktop/src/lib/intl/messages/zh-Hant/commands.json | Adds commands.searchQuickFind.label translation key (zh-Hant). |
| apps/desktop/src/lib/intl/messages/vi/fileExplorer.json | Adds type-to-jump quick find hint translation key (vi). |
| apps/desktop/src/lib/intl/messages/vi/commands.json | Adds commands.searchQuickFind.label translation key (vi). |
| apps/desktop/src/lib/intl/messages/sv/fileExplorer.json | Adds type-to-jump quick find hint translation key (sv). |
| apps/desktop/src/lib/intl/messages/sv/commands.json | Adds commands.searchQuickFind.label translation key (sv). |
| apps/desktop/src/lib/intl/messages/pt/fileExplorer.json | Adds type-to-jump quick find hint translation key (pt). |
| apps/desktop/src/lib/intl/messages/pt/commands.json | Adds commands.searchQuickFind.label translation key (pt). |
| apps/desktop/src/lib/intl/messages/nl/fileExplorer.json | Adds type-to-jump quick find hint translation key (nl). |
| apps/desktop/src/lib/intl/messages/nl/commands.json | Adds commands.searchQuickFind.label translation key (nl). |
| apps/desktop/src/lib/intl/messages/hu/fileExplorer.json | Adds type-to-jump quick find hint translation key (hu). |
| apps/desktop/src/lib/intl/messages/hu/commands.json | Adds commands.searchQuickFind.label translation key (hu). |
| apps/desktop/src/lib/intl/messages/fr/fileExplorer.json | Adds type-to-jump quick find hint translation key (fr). |
| apps/desktop/src/lib/intl/messages/fr/commands.json | Adds commands.searchQuickFind.label translation key (fr). |
| apps/desktop/src/lib/intl/messages/es/fileExplorer.json | Adds type-to-jump quick find hint translation key (es). |
| apps/desktop/src/lib/intl/messages/es/commands.json | Adds commands.searchQuickFind.label translation key (es). |
| apps/desktop/src/lib/intl/messages/en/fileExplorer.json | Adds English copy + descriptions for type-to-jump quick find hint. |
| apps/desktop/src/lib/intl/messages/en/commands.json | Adds English copy + descriptions for search.quickFind command label. |
| apps/desktop/src/lib/intl/messages/de/fileExplorer.json | Adds type-to-jump quick find hint translation key (de). |
| apps/desktop/src/lib/intl/messages/de/commands.json | Adds commands.searchQuickFind.label translation key (de). |
| apps/desktop/src/lib/intl/keys.gen.ts | Extends generated message key union with the new i18n keys. |
| apps/desktop/src/lib/file-explorer/pane/TypeToJumpIndicator.svelte | Shows a {shortcut} to search subfolders hint beside the jump buffer when available. |
| apps/desktop/src/lib/file-explorer/pane/types.ts | Adds takeJumpBuffer() to FilePaneAPI. |
| apps/desktop/src/lib/file-explorer/pane/pane-commands.ts | Plumbs takeJumpBuffer() through pane commands to the explorer facade. |
| apps/desktop/src/lib/file-explorer/pane/navigate.ts | Makes { history: 'parent' } walk Back when on a snapshot pane. |
| apps/desktop/src/lib/file-explorer/pane/navigate.test.ts | Adds coverage for exiting snapshot panes via “parent” mapping to Back. |
| apps/desktop/src/lib/file-explorer/pane/FilePane.svelte | Implements takeJumpBuffer() by reading buffer + clearing jump state. |
| apps/desktop/src/lib/file-explorer/pane/DualPaneExplorer.svelte | Exposes takeJumpBuffer() on the ExplorerAPI surface. |
| apps/desktop/src/lib/file-explorer/pane/DETAILS.md | Documents quick find jump-buffer escalation and snapshot-pane “up” behavior. |
| apps/desktop/src/lib/file-explorer/pane/CLAUDE.md | Updates agent guardrails for quick find + snapshot navigation. |
| apps/desktop/src/lib/commands/sources/main-window.ts | Registers search.quickFind with shortcut ⌘⇧F and palette visibility. |
| apps/desktop/src/lib/commands/command-registry.test.ts | Adds search.quickFind to expected palette IDs. |
| apps/desktop/src/lib/commands/command-registry.parity.test.ts | Updates expected English command name parity for search.quickFind. |
| apps/desktop/src/lib/commands/command-ids.ts | Adds search.quickFind to canonical command ID list. |
Review details
- Files reviewed: 47/47 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| 'search.quickFind': ({ ctx, explorerRef }) => { | ||
| applySearchPrefill({ | ||
| query: explorerRef?.takeJumpBuffer() ?? '', | ||
| mode: 'filename', | ||
| scope: '', | ||
| isDirectory: null, | ||
| autoRun: true, | ||
| }) | ||
| armAutoPromote() | ||
| ctx.dialogs.showSearchDialog(true) | ||
| }, |
e7c3a0d to
100f62d
Compare
|
I've run the branch to see how it feels and will think about whether this is the correct way to do this. I'm not fully convinced either way yet. Give me a bit of time. Operative note: For unrelated reasons, I had to rewrite a commit where this PR branched off from. I've also rebased this PR so that it's not on a disjoint tree. I hope it's OK. (I made no changes to your work, only rebased.) |
|
I'll take a while with this one. I think #85 is a valid ask, and I'll consider this PR as a suggestion for the solution. I'll need to consider what the right solution is and whether it's exactly this PR or something else. So not promising that I'll ever merge this, but I'm promising that I'll look into it again when the roadmap gets there. Personally, I'm not satisfied with the quick search, either, and I use Cmdr (and quick search) every day, so my guess is that this will bother me sooner than later. |
Closes #85. Adds a FreeCommander-style quick search: type in a pane, press
⌘⇧F, get every match under the current folder.What changed
search.quickFind(app-dialog-handlers.ts) takes the pane's type-to-jump buffer whole (ExplorerAPI.takeJumpBuffer(), read + clear) and passes it toapplySearchPrefillas a filename query with an empty scope, so the scope ladder resolves the focused pane's current folder.armAutoPromote()(snapshot-promotion.ts) arms a one-shot flag; the search dialog opens, auto-runs, andSearchDialog's auto-promote effect promotes the first LIVE run's first batch into a snapshot pane through the existingshowAllInMainWindow(⌥⏎) path.navigateHistory's'parent'arm now takes the'back'branch on a snapshot pane instead of no-oping, so Backspace /⌘↑/ MCPnav_to_parentall walk back out of quick-find results to the folder they came from.{shortcut} to search subfolders).commands.searchQuickFind.labelandfileExplorer.typeToJump.quickFindHintkeys, propagated to all locales.Why this shape
promoteResultsToPanereturnsnull), so the first batch is the earliest correct promotion point.Testing
navigate.test.ts: back-navigation out of a snapshot pane.auto-promote.test.ts,SearchDialog.auto-promote.svelte.test.ts: arm/consume lifecycle.type-to-jump.spec.ts(Playwright E2E): new quick-find cases.