Skip to content

feat(sim): the simulate view — canvas, inspector, call form - #18

Merged
Kinflou merged 1 commit into
masterfrom
feat/sim-1d-view
Sep 2, 2026
Merged

feat(sim): the simulate view — canvas, inspector, call form#18
Kinflou merged 1 commit into
masterfrom
feat/sim-1d-view

Conversation

@Kinflou

@Kinflou Kinflou commented Sep 2, 2026

Copy link
Copy Markdown
Member

Milestone 1d of playground simulation — everything 1c does, now through the UI.

  • Header gains an edit / simulate toggle. Simulate takes the full width (generation controls hide); entering it runs describe_project on the current schemas and (re)builds the view's session.
  • sim/ui/view.ts — a palette of protocol × role (drag onto the canvas), a two-lane canvas with an SVG wire between the connected pair, and an inspector: instance facts + ir_hash (click to copy), a connect to … select of valid partners, per-function behaviour pickers (kind + a JSON config box, applied live), and — for a connected client — the call form.
  • sim/ui/argsform.ts — a form from a function's args: typed input per primitive, a fieldset per struct, a select per enum, a JSON textarea for arrays / unions / unresolved, and a whole-form raw-JSON toggle.
  • sim/ui/framelog.ts — the frame list under the canvas, fed by the tap.

Tests

sim/view.test.ts drives the 1d acceptance through a real DOM (linkedom):

✔ 1d — place, connect, call, and see the reply and frames
✔ 1d — flipping the server to Raise error surfaces the mapped error

14/14 sim tests pass (2 new DOM + 12 from 1a–1c). npm run build green; main bundle +~8 KB gz now that the sim is imported from an entry.

Not in 1d (spec puts them in 1e / deferred): free-form node dragging, drag-to-connect, and the frame inspector (expand, hex, framing label, latency) — 1d's frame list is plain rows.

Milestone 1d (docs: design/playground-simulation.md). Everything 1c does,
now through the UI.

- header gains an edit / simulate toggle; simulate takes the full width
  (generation controls hide). Entering it runs describe_project on the
  current schemas and (re)builds the view's session.

- sim/ui/view.ts — palette of protocol × role (drag onto the canvas),
  a two-lane canvas with an SVG wire between the connected pair, and an
  inspector: instance facts + ir_hash (click to copy), a "connect to …"
  select of valid partners, per-function behaviour pickers (kind + a JSON
  config box, applied live), and — for a connected client — the call form.

- sim/ui/argsform.ts — a form from a function's args: typed input per
  primitive, a fieldset per struct, a select per enum, a JSON textarea for
  arrays / unions / unresolved, and a whole-form raw-JSON toggle.

- sim/ui/framelog.ts — the frame list under the canvas, fed by the tap.

- sim/view.test.ts (linkedom) — the 1d acceptance driven through the DOM:
  drop a server + client, connect via the inspector, send from the call
  form, see the reply and the frames; then flip the server to Raise error
  and see the mapped error.

14/14 sim tests pass. Main bundle +~8 KB gz (the sim is imported now).
@Kinflou
Kinflou merged commit cb1f428 into master Sep 2, 2026
2 checks passed
@Kinflou
Kinflou deleted the feat/sim-1d-view branch September 2, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant