fix: suggest filter values by their label and in any case
What does this PR do?
The filter bar on the Runs page (and every list page that uses FilterSearchbar) suggests values for a filter as you type, but only when the typed text appears in the option's value, with the same case. So timeframe:within suggests nothing, though all seven timeframes are labelled "Within …", and job_trigger_kind:pub does not offer GCP Pub/Sub, whose value is gcp. The user types what the list shows, the label, and gets an empty list.
This PR matches the typed text against the option's label as well as its value, ignoring case. 2 lines added, 1 removed, in FilterSearchbar.svelte. Nothing changes for options whose label is their value except the case.
Reproduced on main at 28985a1 (CE v1.882.0).
flowchart TD
A[User types part of a filter value] --> B{Text matches the label or another case}
B -->|Before| C[No suggestion offered]
B -->|After| D[Matching options suggested]
Narrated recording, before then after (sound on):
https://github.com/user-attachments/assets/9cc2c04b-e2cb-436c-a883-5b8c43668b44
The recording is the real app (frontend dev server from this checkout against the main backend image). Waits on page loads are shortened; nothing else is edited.
Edge cases and unchanged behaviour checked
All checked in the running app, on this branch:
- A label-only match:
eventsuggests Azure Event Grid (valueazure). - Capitals:
timeframe:WITHINsuggests the same seven timeframes. - Unchanged: typing a value (
kafka) still suggests Kafka. - Unchanged: Enter on a suggestion applies it (
?job_trigger_kind=kafka).
Not changed here: on the Variables page the path suggestions are built from the rows the current filter returns, so once a partial path is typed the list is empty and has nothing to suggest. That is a separate issue and is the same with and without this change.
Checks run
oxlinton the changed file: passes.prettier --check(withprettier-plugin-svelte) on the changed file: passes.- Not run:
npm run check(svelte-check needs about 8 GB here) andnpm run check:fast(no bun on this machine). - No test added:
docs/validation.mdasks for none on pure UI changes.
Related issue
None filed. Found while filtering runs by timeframe.
AI tools (Claude Code) assisted with this change; the bug was reproduced on main and the fix verified in the running app as shown.
🤖 Generated with Claude Code
Summary by cubic
Fixes filter value suggestions in the search bar so typing a label fragment or different capitalization still offers matching options. Previously only the option's value was matched, case-sensitively—so timeframe:within offered nothing and job_trigger_kind:pub missed GCP Pub/Sub. Suggestions now match both label and value, ignoring case.