Skip to content

feat(ui): inspector shell — workspace model + trace loading #27

Description

@sepehr-safari

Summary

Replace the placeholder counter with the foundation of the native inspector: the
inspector Model / Msg / update, the main view, and the trace-loading
path. This is the S3 skeleton every later pane hangs off of.

Why a Zig builder view (ADR-0006)

The event timeline (#28) must scale to dataset-size traces within the 1024
widget-node per-view budget, which requires the windowed virtual list
(ui.virtualWindow / ui.virtualList). Per the native-ui contract that
primitive is builder-only — the closed markup grammar has no channel for the
runtime's range request. So the main inspector view is a hand-written
canvas.Ui(Msg) builder view (.view = view), not a .native markup file. This
PR records that as ADR-0006 and removes the placeholder src/app.native.

Scope

  • Workspace model — a bounded set of open traces (Trace + derived
    ParseResult / []Session / []Failure from the engine), an active-trace
    index, and per-trace selection state. Deriving-not-storing: counts, the active
    trace, filtered views are methods, not fields.
  • Trace loading — read trace files named as command-line path arguments
    in main (via init.io, unbounded — the large-file path feat(engine): trusted-ingestion parse path + streaming (500k / 100 MB) #29 depends on), parse
    through the engine, and seed the workspace. Multiple paths open multiple traces.
  • Embedded sample@embedFile the vendored normal-session fixture as a
    built-in "Open sample" affordance so the empty state is actionable and the
    automation smoke test always has content.
  • Shell — grow the main window to inspector size; a header (active trace name
  • Parse-error surface — a bad/oversized file yields a visible error state,
    never a crash (untrusted-input discipline).

Acceptance criteria

  • Model / Msg / update for the workspace; every arm covered by headless
    tests via the canvas.MarkupView/Ui + msgFor* dispatch path.
  • studio <trace.json> loads and renders the trace header + counts; no args
    shows the empty state with a working "Open sample".
  • Multiple path args produce multiple workspace tabs; switching is model-owned.
  • ADR-0006 committed; src/app.native removed; native check --strict clean.
  • native test -Dplatform=null green on macOS + Linux; window opens (smoke).
  • CURRENT_STATE.md / AGENTS.md updated in-PR.

Dependencies

Milestone S3. Foundation issue — blocks #28, #30, #31, #32.

Notes

Interactive open (native dialog, drag-drop) is intentionally out of scope for
S3 and tracked separately (#33) — the zero-config UiApp exposes no view/effect
path to showOpenDialog or file-drop routing; it needs an ejected runner.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions