Repository navigation
feat(files): also search the home folder with Spotlight on macOS - #53
Merged
Merged
Conversation
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.
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.
What changes
From the comparison with bopop. Decisions: off by default, home folder only, names only.
spotlightFiles, default off).spotlight_filesasks Spotlight, and the launcher appends its results (its ownlatestOnlyqueue, 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.State::foundkeeps 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.files::found_result): a pin resolves through the index.Measured
mdfindtakes 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
bun run verifyTINYDASH_LIVE_SPOTLIGHT=1 cargo test live_spotlightNot checked
The Files tab in the running app (typing needs key presses); the launcher tests cover the merge.