Browser runtime

chops-search.js runs in one of two modes, chosen automatically at load.

Mode selection

Page contains #chops-input?Mode
NoOverlay: a dialog is mounted as a direct child of <body>
YesInline: the existing markup is driven in place

Element contract (inline mode)

ElementRequirement
#chops-inputThe query input
#chops-resultsMust be a <ul>; results are appended as <li>
#chops-modeA <span>; receives the status line (aria-live recommended)

In inline mode, showing/hiding the container, clearing behaviour, and stacking context are your responsibility.

Data attributes (both modes)

AttributeEffect
data-chops-openOpens the overlay on click, Enter, or Space
data-chops-clearWired as a clear button; an empty element gets the icon injected

Programmatic clearing must dispatch the event, since setting .value fires nothing: input.dispatchEvent(new Event('input')).

Keyboard

KeyAction
Ctrl/Cmd-K or /Open (overlay mode; / only outside text fields)
Move through results ( from no selection goes to the last)
Ctrl-N / Ctrl-PSame, readline-style (some browsers reserve Ctrl-N)
EnterOpen the selected result
Esc or Ctrl-[Clear the query; close if already empty

Status line

#chops-mode reports the states a user needs to know about: keyword-only mode when semantic rows can't load, and unavailability when the engine can't boot. See Designed degradation for when each occurs.

Theming

Every colour in the built-in overlay derives from currentColor; the custom properties on .chops are the theming surface, so the dialog inherits your site's palette and a handful of property overrides tune the rest. The stylesheet is search/chops-search.css, regenerated by every build, so put overrides in your own stylesheet rather than editing it.

Network behaviour

The page script spawns search-worker.js, which loads the wasm engine (from search/pkg/, version-queried), plans byte ranges per query, and persists fetched rows in a Cache API row cache. Queries are debounced, and a superseded in-flight query is dropped rather than raced. The artifact reference lists what loads when.