Skip to content

feat(ui): search & filter — close out S3#40

Merged
sepehr-safari merged 1 commit into
mainfrom
feat/search-filter
Jul 11, 2026
Merged

feat(ui): search & filter — close out S3#40
sepehr-safari merged 1 commit into
mainfrom
feat/search-filter

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

Summary

Makes large traces navigable with search & filter, and closes out S3 —
Inspector UI (0.2.0)
.

  • Free-text search — a real search_field (with its built-in clear
    affordance) matching action / unique id / payload substring, case-insensitive.
  • Toggle facets — message type (Call / Result / Error), direction (from CP /
    from CSMS), and severity (participates in a failure of level X). Facets
    AND-compose with each other and the search.
  • Instant + viewport-bounded — the filtered index set is derived in the build
    arena and becomes the virtual list's source, so a filtered huge trace never
    materializes hidden rows. The status bar shows N of M events; an empty result
    shows a quiet "no matching events".
  • Clear — the search field's clear (x / Escape) arrives as a .clear edit
    through the same input path; a Clear button resets every facet and the query.

Design notes

  • Filter lives on the Model, not per-trace. LoadedTrace values are memcpy'd
    during tab compaction, which would dangle a self-referential search slice. The
    Model has a stable address, and the query is stored as a fixed buffer + length
    • caret (no stored slice pointer), so the whole Filter stays trivially
      copyable. Edits apply into a scratch buffer then copy back — no aliasing.
  • Controlled input via TextEditState. TextInputEvent is an edit delta, so
    update reconstructs the query with applyTextInputEvent. The headless tests
    drive the exact msgForTextEdit path the runtime uses.
  • Derive once. view computes the filtered indices a single time and threads
    them to both the timeline and the status bar; unfiltered traces allocate no
    index array at all.

Testing

native test -Dplatform=null — 89 headless tests green (macOS local; CI runs
both OSes). New coverage:

  • The free-text predicate (action / id / payload keys + values, case-insensitive,
    bounded), and the facet toggle + clear logic.
  • Search build/delete/clear through real edit events; a message-type facet
    narrowing the count and the Clear button restoring it.
  • A filtered 2000-event trace's whole widget tree stays under the node budget
    (no hidden-row materialization).
  • The empty-result state, and the accessibility sweep over the active filter bar.

native check --strict clean; native build (ReleaseFast) builds. Living docs
(CURRENT_STATE.md, ROADMAP.md, AGENTS.md) updated in-branch and S3 marked
complete.

Deferred (tracked, not blockers)

Interactive open — native dialog + drag-drop (#33) — and the timeline viewport
scroll on jump both need an ejected runner (ADR-0006).

Closes #32

Make large traces navigable and close the Inspector UI milestone.

- Free-text search field (a real search_field with a clear affordance) matching
  action / unique id / payload substring, case-insensitive. The model owns the
  query as a fixed buffer + caret and applies edit deltas via TextEditState, so
  the filter state stays trivially copyable (no self-referential slice).
- Toggle facets — message type, direction, and severity (participates in a
  failure of level X) — that AND-compose with the search.
- The filtered index set is derived in the build arena and becomes the virtual
  list's source, so filtering a huge trace materializes no hidden rows and stays
  viewport-sized. The status bar shows "N of M events"; an empty result shows a
  quiet "no matching events".

The search-field clear (x / Escape) arrives as a `.clear` edit through the same
input path, restoring the full timeline.

Tests: the free-text predicate (action / id / payload, case-insensitive), the
facet toggles, search build/clear through edit events, a filtered large trace's
node count staying viewport-sized, the empty-result state, and the a11y sweep
over the filter bar.

Closes #32
@sepehr-safari sepehr-safari added the type:feature New capability label Jul 11, 2026
@sepehr-safari sepehr-safari added this to the S3 — Inspector UI milestone Jul 11, 2026
@sepehr-safari sepehr-safari added the area:ui Native markup views label Jul 11, 2026
@sepehr-safari
sepehr-safari merged commit 6812c5a into main Jul 11, 2026
3 checks passed
@sepehr-safari
sepehr-safari deleted the feat/search-filter branch July 11, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui Native markup views type:feature New capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ui): search & filter — close out S3

1 participant