Skip to content

feat(gallery): scope a search to the bucket on show - #95

Merged
IAmJSD merged 1 commit into
mainfrom
t3code/44ade0c8
Sep 2, 2026
Merged

IAmJSD merged 1 commit into
mainfrom
t3code/44ade0c8

Conversation

@IAmJSD

@IAmJSD IAmJSD commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Searching while viewing a bucket used to rank the whole library and ignore the bucket. Now the bucket filters first and the query ranks what is left.

  • Scoped before the cut. The keystroke search and the AI tool's search restrict scoring to the viewed bucket's contents (hand-added photos plus a smart rule's current matches), so the bucket's photos are never crowded out of the kept 200 by the rest of the library.
  • The search follows the bucket. The library records which bucket the results were ranked in; each gallery frame compares it to the bucket on show and re-ranks on a change. A viewed smart bucket refilling re-ranks too. Escape clears the query and shows the whole bucket.
  • The grid says so. Header reads Bucket · <name> · Search results (with · near <place> when the query named one); a photo removed by hand leaves the strip at once; empty results get their own message in and out of a bucket.
  • MCP. Both gallery_search tools take an optional bucket. The in-app one switches the gallery to it as it searches and reports it in the reply and in gallery_state; the headless one scopes to the hand-added photos it can see. An unknown name is an error, not a library-wide search.
  • The shared rank() in schist-gallery gains the scope parameter, plus a Ranked alias that clears a clippy complexity warning.
  • Docs: new paragraph in the Search section of docs/gallery.md.

Test plan

  • New unit test in schist-gallery: scope filters before the floor; an empty bucket searches nothing
  • New unit test in schist-app: search_scope() returns the bucket's contents deduplicated, and nothing for a stale slot
  • Existing gallery tests, clippy on gallery/mcp/app, rustfmt all clean
  • Headless GUI check of the sidebar-click re-rank and header text (not done; verified by reading)

🤖 Generated with Claude Code

Searching while viewing a bucket used to rank the whole library and
ignore the bucket. Now the bucket filters first — its hand-added
photos and a smart rule's current matches — and the query ranks what
is left, scoped before the two-hundred cut so the bucket's photos are
never crowded out. The search follows the bucket: switching buckets
under a live query re-ranks, a viewed smart bucket refilling re-ranks,
and the strip keeps to the bucket's current contents so a hand removal
leaves at once. The header says "Bucket · name · Search results", and
empty results get their own message.

Both gallery_search MCP tools take an optional bucket; the in-app one
views it as it searches, the headless one scopes to the hand-added
photos it can see. The shared rank() gains the scope parameter, with
tests in both crates.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@IAmJSD
IAmJSD merged commit d5ee492 into main Sep 2, 2026
4 checks passed
@IAmJSD
IAmJSD deleted the t3code/44ade0c8 branch September 2, 2026 19:11
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