web: parse search type prefixes into kind filters

This commit is contained in:
2026-10-20 17:31:42 +01:00
parent 35040fe13f
commit a670610497
5 changed files with 195 additions and 14 deletions
+16
View File
@@ -111,6 +111,22 @@ unit-tested in `test/repository.test.mjs` and the model in `test/actions.test.mj
rename's exact server reason and, under `--decide`, the full live decision flow.
## Search
Type-prefix follow-up (2026-10-20, **partial — isolated browser fixture, not a
live-server acceptance run**): unquoted, case-insensitive `t:` / `type:` tokens
accept the existing singular kinds (`pipeline`, `run`, `step`, `field`,
`artifact`, `version`). The last recognized token overrides the selector and is
reflected in Kind and the summary. Selecting Kind or Clear filter removes all
recognized tokens; unsupported and quoted tokens remain literal text. Only the
remaining text and the effective `kind` reach the unchanged `search` request.
Type-only queries show explicit help, not results: `Store.Search` deliberately
returns no results for blank text. Parser tests plus `node test/ui-search-types.mjs`
exercise the real view/repository with recorded fixture requests and no service
connection. Captures: `captures/search-types/01-type-filter.png` through
`06-cleared-filter.png` (including precedence, selector replacement, literal
tokens and type-only help). This browser-only shorthand is not yet on Android;
the earlier live-search acceptance evidence below is unchanged.
| # | Feature | Protocol | Status |
| --- | --- | --- | --- |
| S1 | Omni-search across pipelines, versions, runs, steps, fields, artifacts | `search` | done — the shell's `Search` control (rail on wide, dock on narrow) opens a full-width panel in the workspace flow (field autofocused, placeholder `Search pipelines, runs and artifacts`, a `Close search` control; opening and closing leave the current view, selection and loaded data untouched, Escape closes the field and returns focus to the Search control). One flat result list with no kind grouping, over a controls row: the kind select (`All kinds`/`Pipelines`/`Runs`/`Steps`/`Fields`/`Artifacts`/`Versions`), the sort select (`Relevance`/`Newest first`/`Name`), the one-line `{Kind} · {Sort}` summary and a `Clear filter` reset. The request is exactly `{type:"search",search:{query,kind,limit:0}}` — the server's own default cap, never above `SearchMaxLimit` 200 — debounced 250 ms after the last keystroke with Enter sending at once; a blank query clears locally with no request; the previous results stay visible (a thin progress bar above them) while a newer query loads and a stale reply is dropped by token; the first load shows the spinner and `Searching…`; an error takes precedence over the results. Failure copy is `AppViewModel`'s: a rejection naming an unknown command, or an older server's reply without `search_results`, reads `This server does not support search. Update the Pipelines server, then try again.` and any other failure carries the server's own text. Row text and blank fallbacks mirror `OmniSearchResults.searchRow` (a field hit's snippet emphasises the first case-insensitive query occurrence, never via `innerHTML`) and the empty state keeps Android's `No matches for "{query}".` / `No {kind} match "{query}".`. Captured 2026-10-19: `captures/01-search-results.png` (flat mixed list for the query `plan`, the controls row and summary `All kinds · Relevance`), `captures/02-search-kind-filter.png` (the `Pipelines` filter narrowing the list and the summary to `Pipelines · Relevance`) |