Skip to content

feat(files): also search the home folder with Spotlight on macOS - #53

Merged
jewei merged 1 commit into
mainfrom
feat/spotlight-files
Oct 8, 2026
Merged

jewei merged 1 commit into
mainfrom
feat/spotlight-files

Conversation

@jewei

@jewei jewei commented Oct 8, 2026

Copy link
Copy Markdown
Owner

What changes

From the comparison with bopop. Decisions: off by default, home folder only, names only.

  • Settings > Files > Also search with Spotlight (macOS only, spotlightFiles, default off).
  • Files tab, two steps: the index answers at once as before; then a new command spotlight_files asks Spotlight, and the launcher appends its results (its own latestOnly queue, for the same input only; a failure changes nothing). From 2 characters.
  • platform::find_files: macOS runs /usr/bin/mdfind -onlyin <home> -name <query> with fixed arguments (no shell), reads at most 100 paths, and stops after 1 second. Windows and Linux return nothing.
  • spotlight.rs: drops paths the index already has, and paths that a scan would skip (files::lists: hidden, dot names, skipped folder names, inside packages). It ranks by the same name matcher.
  • Safety: State::found keeps the 500 paths Spotlight returned most recently; Open and Reveal accept indexed paths or these (actions::offered_file). The webview still opens only what TinyDash offered.
  • Spotlight results have no Pin (files::found_result): a pin resolves through the index.

Measured

mdfind takes 190–450 ms per query on this Mac. That is too slow for every keystroke in All, so only the Files tab uses it, after the index.

Commands run

Command Result
bun run verify Pass: 134 frontend tests, build OK, 161 Rust tests
TINYDASH_LIVE_SPOTLIGHT=1 cargo test live_spotlight Pass: real Spotlight results, all under home, no hidden parts, all remembered

Not checked

The Files tab in the running app (typing needs key presses); the launcher tests cover the merge.

With Also search with Spotlight on (Settings > Files, off by default),
the Files tab asks Spotlight for names under the home folder after the
index has answered, and adds up to 100 results below its own. mdfind
runs with fixed arguments and stops after a second; results follow the
index's hidden and skip rules. Open and Reveal accept the 500 paths
Spotlight returned most recently, so the webview still opens only what
TinyDash offered. Windows and Linux return no extra results.
@jewei
jewei merged commit 222b370 into main Oct 8, 2026
6 checks passed
@jewei
jewei deleted the feat/spotlight-files branch October 8, 2026 08:25
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.

1 participant