Skip to content

feat(web): debounced search, kind/status filter chips, no-match tip (BEN-51)#55

Open
benSepanski wants to merge 1 commit intomainfrom
claude/nifty-bardeen-kqsql
Open

feat(web): debounced search, kind/status filter chips, no-match tip (BEN-51)#55
benSepanski wants to merge 1 commit intomainfrom
claude/nifty-bardeen-kqsql

Conversation

@benSepanski
Copy link
Copy Markdown
Owner

Context

src/web/Search.tsx only searched on Enter, lacked filters, gave no result counts, and the no-match copy didn't explain how matching works. (Linear: BEN-51.)

TL;DR

Search updates as you type (250 ms debounce), exposes kind/status filter chips, summarises matches, and explains substring matching when nothing hits.

Summary

  • Debounce input → query at 250 ms; sync URL via replaceState while typing and via location.hash on Enter for shareable links.
  • Result header: N matches across X runs · Y turns · Z events, with · showing K when filters narrow.
  • Filter chips for turn / event and per-status, derived from the result set; all filtering is client-side over the existing /api/search payload (no extra request).
  • No-match state now includes a one-line tip ("case-insensitive substring matches over turn content and event payloads").
  • Extracted pure helpers (summarizeMatches, filterMatches, availableStatuses, toggleSetMember) into searchUtils.ts with 12 vitest cases.

Demo

n/a — automated cron run with no UI capture; pnpm build:web succeeds and pnpm all is green. Manual QA recommended on the four canonical journeys before merge (empty / live / failed / past).

Alternatives

  • Keep submit-only search and add filters next to the button — rejected; the ticket explicitly calls out debounced typing as the expected interaction.
  • Push filter state into the URL — rejected as scope creep; chips reset on reload, which matches the "narrow within a session" intent.
  • Add date-range filtering — deferred; the API has no time window today, so it would be backend work outside this ticket.

Test Plan

  • pnpm all — typecheck + fmt:check + lint + test + eval (163 tests pass)
  • pnpm build:web — web bundle builds (234 kB JS, 23 kB CSS)
  • Manual: type in #/search, confirm results settle without Enter; toggle chips; clear input; verify no-match tip on a query with zero hits.

https://claude.ai/code/session_01Bgm49aWQpv2a6mmddCgW6U


Generated by Claude Code

…BEN-51)

* Search input debounces to 250ms; URL syncs via replaceState while
  typing and via location.hash on Enter.
* Result header summarises matches across runs / turns / events.
* Filter chips toggle by matchKind (turn/event) and per-status, all
  client-side over the existing /api/search payload.
* No-match copy now explains how matching works.
* Pure helpers extracted to searchUtils.ts with vitest coverage.

https://claude.ai/code/session_01Bgm49aWQpv2a6mmddCgW6U
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