Skip to content

fix(popup-menu): honour filter on data-first surfaces - #601

Merged
kianbazza merged 1 commit into
canaryfrom
ship/data-first-search-honour-filter-and-let-forceorder
Oct 28, 2026
Merged

kianbazza merged 1 commit into
canaryfrom
ship/data-first-search-honour-filter-and-let-forceorder

Conversation

@kianbazza

@kianbazza kianbazza commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Data-first surfaces declared filter but never used it: the surface set the store's filter to false in data mode, and the list scored rows with commandScore regardless. The surface's filter now reaches scoring.

 <Surface filter content deepSearch>
   DataSurfaceContext
+    filter
   <List>
     DataListInner
-      filterNodes({ query, nodes, … })
+      filterNodes({ query, nodes, …, filter })
         scoreNodes
-          commandScore(value, query, keywords)
+          filter(value, query, keywords)   // forceScore still wins

filter={false} turns filtering off, as in the composable API: rows render as they do with no search (no deep results, branch loaders stay disabled), while asyncContent query loaders still get the search. That fits content you filter yourself, or a loader that filters on the server.

Evidence

  • Before: a surface with filter={(value, search) => value.includes(search) ? 0 : 1}, searching "an", showed only Banana (the commandScore result). With filter={false}, searching "cherry" showed only Cherry.
    After: the same search shows Apple, Cherry and the deep result Kiwi, and hides Banana. filter={false} shows every row.
  • New tests: data-list.test.tsx › surface filter (2) and async-content-reveal.test.tsx › filter={false} still sends the search to the query loader, and keeps local rows unfiltered. All three fail without the change.
  • bun run check, bun run type-check, bun run test --filter @bazza-ui/react (1532 passed).

Merge Danger

Door: two-way

Blast Radius: small

Data-first surfaces that already passed a custom filter now get its scores instead of commandScore. Ones that passed filter={false} now show every row unfiltered, where before they filtered with commandScore.

@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ui-canary Ready Ready Preview Oct 28, 2026 12:08am UTC

Request Review

@linear-code

linear-code Bot commented Oct 28, 2026

Copy link
Copy Markdown

UI-656

@kianbazza
kianbazza marked this pull request as ready for review October 28, 2026 15:36
@kianbazza
kianbazza merged commit 150bf4a into canary Oct 28, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview – ui-canary — 669bb34b Deployed Oct 28, 2026 by vercel[bot]
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