Skip to content

feat(ui): better flows - #22

Merged
ajaishankar merged 2 commits into
mainfrom
feat/flow-inputs
Oct 24, 2026
Merged

ajaishankar merged 2 commits into
mainfrom
feat/flow-inputs

Conversation

@ajaishankar

@ajaishankar ajaishankar commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

What

A flow's inputs get their own roomy form, and groups and lists of inputs are drawn as tables instead of a line of raw JSON.

  • Inputs stop. The first entry of the timeline. On a wide screen the form fills the right pane (empty before a run today); on a narrow one it unfolds inline under the stop, folds away for a run, and the Run row stays pinned at the top.
  • Groups. c.object(shape, { label }); neighbouring groups with the same fields are one table, a row each. Cards on narrow widths (container query). One die per row.
  • Lists. c.array(item, { min, max, label }) has a count field, a remove button per row, and fresh generated values for new rows. default may be a function; each item starts from its own defaults. A list with no value starts at min (it used to fail Run with defaults and specbook test).
  • Values. Generated fields work inside groups and lists (Generate all, row die, faker readiness). Presets (data-specbook-inputs) merge deeply, and Run with defaults includes the preset. A select default other than the first option is honoured in the form, as in the CLI. Errors name the path, e.g. travelers[2].gender.
  • Typed inputs are kept while the panel is away (the Docs tab used to wipe them), per flow, seed and locale.
  • Docs tab lists nested controls; generated defaults are said to be generated, not made.
  • Example. A Dynamic inputs flow in the UI group, no request, to show the controls.
  • Flow views load on demand (Host.tsx) to keep the embed's first-click size within budget.
  • Docs. The Test page gets a short paragraph on repeating inputs (c.object / c.array) with a link to the demo flow (demo.specbook.dev/#/seq/ui-demo, live once the demo is redeployed), and the new-pet snippet on that page now shows only the flow's inputs, not its steps.

Notes for review

  • Not changed: how flows run, the file format, anything outside the panel and the control builders.
  • Tests: new unit and browser tests (inputs.test.ts, browser/inputs.test.tsx, core control and runner tests), an embed test at desktop width, and I checked that the new ones fail when the behaviour is broken. The two app tests that count the example's flows go from 5 to 6.
  • The embed scrollbar test now skips on a machine whose scrollbars take no room (macOS overlay scrollbars), instead of failing.
  • Not tested: a real iPhone (on-screen keyboard, Safari touch scrolling).
  • Known, unchanged: saving a flow's header still reloads the page in specbook dev; a reload-free update is planned separately.

🤖 Generated with Claude Code

ajaishankar and others added 2 commits October 24, 2026 08:59
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e demo

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ajaishankar
ajaishankar merged commit 07e4ead into main Oct 24, 2026
7 of 8 checks passed
@ajaishankar
ajaishankar deleted the feat/flow-inputs branch October 24, 2026 14:47
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