No.305 · Data
Search Lens
Search that filters the page you're on, in place. Matches stay exactly where they were and everything else folds to a hairline at its own position, so the page becomes a map of where the matches sit. Escape unfolds it again.
The prompt
Written for the variant you picked above: Paper
Build a search that works as a lens over the page's own information instead of a floating command menu. The page is a project view with sectioned lists (Issues, Docs, People). Its header holds the title and a compact search field with a '/' hint. Focusing the field makes the title give way (max-width to 0, fade) while the field grows to the full header width (flex-basis, 380ms). Once there is a query, the typed text is set larger and heavier: the query is the page's heading now. As you type, the page filters in place: - Matching rows stay exactly where they were, with the matched substrings marked. - Every other row folds (grid-template-rows 1fr → 0fr) down to a 5px slot showing a 1px hairline, so the list becomes a density map of where the matches sit in the whole. Nothing reorders and nothing moves except what didn't match. - Section headers switch to 'Issues 3 / 8'. Under the field, facet chips fold open: one per section, with match counts, that can be toggled off. Typing a known operator ('owner:', 'status:', 'is:') swaps the facets for value suggestions (Tab accepts), and 'key:value ' followed by a space becomes an inline chip in the field; Backspace on an empty field removes the last chip. A remote group ('Elsewhere in GUtech Studio') loads after a short debounce with a 1px scanning line, then lists its hits with their place. The empty state names the query and offers Clear search / Remove filters. Keyboard: '/' focuses from anywhere. ↑/↓ moves an active match in place (aria-activedescendant, scrolled into view, a 2px accent edge). Enter unfolds that row's detail inline. Escape clears and unfolds the page, and a second Escape leaves. Paper and Night themes. Selected variant — Paper (paper): Palette for this theme (Paper): --sl-accent #b4532a; --sl-active rgb(27 26 23 / 0.045); --sl-bg #ffffff; --sl-field #f6f5f1; --sl-hair rgb(27 26 23 / 0.16); --sl-ink #1b1a17; --sl-line rgb(27 26 23 / 0.09); --sl-mark rgb(245 190 80 / 0.38); --sl-muted #77736b. Treat these as the root colour tokens, one value per role, and name them to suit your code. Select it with the theme option set to "paper". Keep every dimension, spacing value, state and motion from the brief unchanged, and keep text at 4.5:1 contrast or better on these surfaces. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Press / (or click the field), type 'deploy', add 'owner:hamza ', then ↑↓ and Enter. Esc restores the page. Motion: Header hand-over 360–380ms; rows fold to hairlines in 320ms; facets fold 320ms; the remote scanning line runs 1.1s. Accessibility: The field is a combobox controlling the page, which becomes a listbox of options while searching. aria-activedescendant tracks the active match, and hidden rows are aria-hidden. A polite live region reports the match count and remote progress. Chips have labelled remove buttons, and facets are toggle buttons with aria-pressed. Reduced motion removes the fold, header and scanning animations but keeps the hairline map. Responsive behavior: Fluid to 280px. Facets scroll horizontally and the header field shrinks to 9rem until focused. Touch: Tap the field; tap a facet or suggestion; tap a match to unfold it. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.
Notes
- Interaction
- Press / (or click the field), type 'deploy', add 'owner:hamza ', then ↑↓ and Enter. Esc restores the page.
- Motion
- Header hand-over 360–380ms; rows fold to hairlines in 320ms; facets fold 320ms; the remote scanning line runs 1.1s.
- Accessibility
- The field is a combobox controlling the page, which becomes a listbox of options while searching. aria-activedescendant tracks the active match, and hidden rows are aria-hidden. A polite live region reports the match count and remote progress. Chips have labelled remove buttons, and facets are toggle buttons with aria-pressed. Reduced motion removes the fold, header and scanning animations but keeps the hairline map.
- Responsive
- Fluid to 280px. Facets scroll horizontally and the header field shrinks to 9rem until focused.
- On touch
- Tap the field; tap a facet or suggestion; tap a match to unfold it.