Add on-device Ask search mode - #11
Merged
Merged
Conversation
Adds an "Ask" search mode that turns a natural-language request into literal filters using the on-device Apple Intelligence model, then applies those filters locally to clipboard text, OCR text, website, source app, and last copy date. - AskSearch builds a plan from the request; filtering never leaves the Mac - Ask waits for Return before planning; a second Return accepts the selection - Falls back to exact search with a status message when the model is unavailable or fails - Search mode menu next to the search field, with availability hints in General settings - Fix the search field placeholder not updating on mode change - Format the detail panel copy date with a single DateFormatter
|
Link and domain filters only inspected the flattened plain text, so an anchor copied as rich content matched nothing: plainText keeps the visible text and drops the href. Read destinations from the stored HTML and RTF content as well, and only load that content when the plan needs links.
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.
Summary
FoundationModels), and Lodge applies those filters locally to clipboard text, OCR text, website, source app, and last copy date. Only the request reaches the model — clipboard contents never leave the Mac.yyyy-MM-ddvalues, and app/date filters are dropped unless the phrase actually appears in the request, so the model cannot invent filters.github.comalso matches its subdomains but not lookalikes such asnotgithub.comorgithub.com.example.org.DateFormatterinstead of three stackedTextviews.Test plan
xcodebuild test -scheme Lodge— new coverage inHistoryTests(Return gating, exact-search fallback, stale response discarded) andSearchTests(combined app/type/date/text filters, link and domain matching, filter-evidence rules, relative date ranges across a DST boundary, invalid domain/date rejection)