feat(sim): the simulate view — canvas, inspector, call form - #18
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Milestone 1d of playground simulation — everything 1c does, now through the UI.
edit/simulatetoggle. Simulate takes the full width (generation controls hide); entering it runsdescribe_projecton 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.tsdrives the 1d acceptance through a real DOM (linkedom):14/14 sim tests pass (2 new DOM + 12 from 1a–1c).
npm run buildgreen; 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.