Repository navigation
feat(search): turn results into a triage surface - #23
Merged
Merged
Conversation
Search is the entry point for every real question against a 10k+ store, and results were flat 80-char prefixes that discarded most of what /recall returns. Result rows now show: a snippet windowed around the first literal match with every in-window occurrence highlighted; a 'matched: tag' chip when the hit is in tags rather than content; a thin importance bar (same encoding as node size in the scene); and a compact relative date. The header gains a Relevance | Recent | Important sort strip and per-type filter pills with counts — pills reset when the query changes so a stale refinement can never silently filter a new search. The 100-result server cap gets a refinement banner instead of silence. The search bar remembers the last 5 settled queries (2.5s dwell so typing prefixes never pollute the list) and offers them with their match counts on focus, portaled past the header's overflow clipping. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR upgrades the search UI from a flat prefix list into a richer “triage surface”, adding snippet highlighting, tag-hit signaling, relative dates, importance cues, client-side sorting/filtering controls, and a recent-searches affordance to make large-store search results more scannable and actionable.
Changes:
- Add shared snippet/tag-match/relative-date helpers for consistent search-result presentation.
- Enhance search results with sort modes, type-pill filtering, capped-results guidance, match-highlight snippets, tag-hit chips, importance bars, and relative timestamps.
- Add persisted recent-search history (last 5, dwell-based) and a portaled dropdown in the search bar.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/lib/searchSnippet.ts | Introduces pure helpers for windowed snippets + highlighting, matched-tag detection, and compact relative time formatting. |
| src/components/SearchResultsList.tsx | Turns results into a triage UI with sorting, type pills, capped banner, richer rows (snippets/highlights/chips/bars/dates), and an empty-visible state. |
| src/components/SearchBar.tsx | Adds a portaled recent-search dropdown and associated props/types for showing prior queries with counts. |
| src/App.tsx | Persists and supplies recent searches using a dwell timer keyed off settled recall results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Keyboard support for the recent-searches dropdown via the combobox pattern: ArrowDown/Up cycle a highlighted row, Enter selects, Escape closes — all handled on the input so focus never leaves it and blur can't race the selection. Panel gets role=listbox/option with aria-selected; input gets role=combobox + aria-expanded/controls/autocomplete. - Skip recording zero-result searches (behavior now matches the comment — a query with nothing in store isn't worth offering as a shortcut). - Type-filter reset keeps Set identity when already empty (no extra state update per keystroke). - Zero-visible-rows message falls back to a generic 'No results.' when no type filter is active (defensive — that branch is unreachable today). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ene, pill-synced graph Three pieces of review feedback on the triage surface: - Match highlights were illegible: Tailwind opacity modifiers (bg-accent/25) silently drop when theme colors are CSS-var strings, so <mark> fell back to the UA's yellow with near-white text. Explicit rgba classes now give a near-white wash with white text (same fix for the matched-tag chip and the capped banner riding bg-warn/10). - The spotlight never visually landed: matches brighten 2.0x into the bloom while non-matches keep their hue and recede into the void (multiplyScalar 0.15 — no gray lerp; that read as mud). True per-instance alpha was tried and rejected: translucent spheres still write depth, punching silhouette holes in the edge web. The additive-blended cluster nebulas re-accumulate to full glow at any nonzero opacity and were drowning the dim — they hide during spotlight (their own fade animates the transition), ambient edge particles pause, and the ~7k-edge web recedes to 30%. - The sidebar's type pills now drive the scene: the filter is lifted to App and gates the canvas matchingIds, so narrowing the list narrows the spotlight (and label priority) too. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
Pushed 7a27917 addressing Jack's review feedback:
🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
PR-4 of the UX roadmap (after #19/#20): search results become a triage surface instead of a flat list of 80-char prefixes. For a 10k+ store, "which of these rows actually answers my question" is the whole game — and
/recallalready returned everything needed; the UI was discarding it.Result rows
<mark>)matched: tag-namechip when the hit is in tags rather than content (semantic-only hits show neither)13d,8mo) with the absolute date on hoverHeader
Search bar
Verification (live, 10k-memory local store)
matched: stacyofflinechips + content highlights where the literal occursstacyoffline · 74 in store / memory · 99 / railway deployment · 43; clicking re-runs the search and closes the panelresults.length >= 100can't trigger locally; it rides the samecappedflag that already renders the "+" suffixnpm run lint(0 errors, 14 warnings = baseline) +npm run buildgreen🤖 Generated with Claude Code