Skip to content

search + tag filter: intended composition (AND) vs shipped drill-down (one hash only) #25

Closed

Description

@utof

Reviewer I1 on v0.6.1 — design-decision issue, not a code bug.

Current behavior (shipped in `3be301e`)

`apps/desktop/src/App.tsx` has `searchHash: string | null` state. Clicking a result sets `searchHash` to ONE specific hit and clears `selectedTagId`. The visible file list is filtered to that single hash. Search is mutually exclusive with the tag filter.

Plan-prescribed behavior (`docs/superpowers/plans/2026-04-16-v0.6-search.md` Task 6 Step 2)

`searchHits: SearchHit[] | null` state (plural). Composition: `visibleFiles = files.filter(f => tagPredicate(f) && searchPredicate(f))` where `searchPredicate` is a `Set` of hashes from `searchHits`. Search narrows the list; tag filter still applies.

Also referenced in spec §6: "renders FileTable / FileGrid filtered to matching hashes (preserves tag filter composition)".

Trade-offs

Plan / compose (`files.filter(tag && search)`) Shipped / drill-down (one hash)
Discoverability Shows all matching files at once Hides the rest; requires re-search to see them
Tag-scoped search Works naturally Broken (clears the tag filter)
Implementation `Set` of hashes `string`
UX clarity for "the one file I want" Still fine — click a row after narrowing Direct click → single-file view
Keyboard nav One of many One focused

Options

  • (A) Restore compose-on-match per plan. Revert `searchHash` → `searchHits`, compose with tag predicate. Requires updating SearchBar interface or App state handling.
  • (B) Document drill-down as the new design. Update spec + plan post-hoc, add WHY comment in `App.tsx` explaining the deviation.
  • (C) Hybrid: while search has an open dropdown, render `files.filter(tag && set-of-hashes)`; clicking a hit narrows further to single-hash; `Escape` or clear restores.

Will be addressed via full superpowers:brainstorming → spec → plan flow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions