Skip to content

Add URL-synced tokenized set-name search to /db/set-list - #576

Merged
geoffrey-wu merged 4 commits into
mainfrom
copilot/add-search-bar-to-db-set-list
Sep 5, 2026
Merged

Add URL-synced tokenized set-name search to /db/set-list#576
geoffrey-wu merged 4 commits into
mainfrom
copilot/add-search-bar-to-db-set-list

Conversation

Copilot AI commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

/db/set-list had no way to narrow large set lists or preserve filter state in shareable links. This change adds client-side set-name filtering with URL persistence, using AND semantics across space-separated terms.

  • Search UI

    • Adds a Search set names input above the set metadata table on /db/set-list.
  • Tokenized filtering behavior

    • Filters rows by set name only.
    • Splits the query on whitespace and requires every token to be present in the set name (case-insensitive), so multi-word queries behave as intersection filters.
  • URL state synchronization

    • Reads initial query from ?q=... on load and applies it immediately.
    • Updates q via history.replaceState as the user types, enabling reload/share/back-forward with filter state intact.
    • Removes q when the normalized query is empty.
function rowMatchesSearchQuery (row, searchQuery) {
  const setName = row.dataset.setName.toLowerCase();
  const searchTokens = searchQuery.trim().toLowerCase().split(/\s+/).filter(Boolean);
  return searchTokens.every(token => setName.includes(token));
}

Co-authored-by: geoffrey-wu <42471355+geoffrey-wu@users.noreply.github.com>
Copilot AI changed the title Add set-list search with URL-synced filtering Add URL-synced tokenized set-name search to /db/set-list Sep 5, 2026
Copilot AI requested a review from geoffrey-wu September 5, 2026 15:26
@geoffrey-wu
geoffrey-wu marked this pull request as ready for review September 5, 2026 18:03
@geoffrey-wu
geoffrey-wu merged commit 77169d0 into main Sep 5, 2026
2 checks passed
@geoffrey-wu
geoffrey-wu deleted the copilot/add-search-bar-to-db-set-list branch September 5, 2026 18:03
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.

2 participants