Skip to content

feat(forge): Mockups stage, explicit early finish, single action bar - #85

Merged
tomasz-zajac-oss merged 1 commit into
mainfrom
feature/forge-mockups
Sep 23, 2026
Merged

tomasz-zajac-oss merged 1 commit into
mainfrom
feature/forge-mockups

Conversation

@tomasz-zajac-oss

Copy link
Copy Markdown
Collaborator

Summary

This PR changes three things in Radical Forge: a new Mockups stage, a way to finish a run early, and one action bar in the footer.

Mockups stage

  • Stage order. Mockups is a new stage between Scenarios and C4: requirements → fitness → scenarios → mockups → C4. Screens are part of the spec that the architecture is derived from, so they come before C4.
  • What the stage creates. It adds mockup nodes for user-facing screens only. Behaviour that exists only as an API is skipped, and a system with no UI gets no mockups. The nodes are linked with:
    • illustrates: mockup → requirement / scenario
    • navigates-to: mockup → mockup, labelled with the user action that triggers it, e.g. "Pay"
  • C4 stage. It now uses the mockups when deciding the architecture, and adds presented-by (mockup → webapp / container). This follows the existing pattern for constrains on fitness functions: C4 is the first stage where those target elements exist.
  • Wireframes. After the stage, the Generate N wireframes button draws a low-fi wireframe for each mockup that has none. It uses the existing ai/mockupWireframe.ts and makes one call at a time to avoid provider rate limits. It shows progress, can be cancelled, and adds its tokens to the session total. It covers every mockup in the model without a wireframe, including mockups created before this run.

Explicit early finish

  • Finish here. Every stage now has a Finish here button. The user can end the run cleanly instead of closing the modal midway. Everything generated so far stays in the model.
  • Final step. The last step is now called Finish (it was "Export"). It shows each stage with its result, either "+N nodes · +M relations" or "skipped". The .feature export is still on this step.
  • Resume. ← Back from an early finish returns to the stage where the run stopped, so the run can continue.
  • Stepper. Only stages that actually generated something get a ✓. Skipped stages are struck through. Stages the user never reached cannot be opened from the stepper.

Single action bar

  • Flow buttons moved to the footer. Generate, Regenerate, Cancel, Confirm answers / Skip questions and Continue / Finish now appear only in the modal footer. The footer shows whichever button moves the current stage forward.
  • Why. These buttons used to be split between the stage body and the footer. The result was duplicates, for example a Generate button in the body next to a disabled Continue in the footer, and two different Cancel buttons.
  • What stays in the body. Only actions on individual items: Hub import, Edit answers, Generate wireframes, Export.
  • Two small fixes. The stage progress panel no longer appears while wireframes are generating. Edit answers is now hidden while a stage is generating.

Type of change

  • New feature
  • Bug fix (duplicated / misplaced wizard controls)
  • Tests

Checklist

  • npm test passes (391/391)
  • npm run typecheck passes with no errors
  • New or changed behaviour is covered by tests: tests/forgePrompts.test.ts checks the stage order, the Mockups prompt and the C4 presented-by instruction. The wizard UI was checked manually, see below.

Test plan

  • Manual end-to-end run in npm run dev:web with headless Chromium. Playwright intercepted the AI provider requests and returned scripted responses:
    • all stages in the new order
    • the Mockups stage creates 2 mockups with illustrates and navigates-to links
    • Generate wireframes draws both wireframes, and the <script> in the scripted response is stripped
    • the C4 stage prompt contains the mockups and the presented-by instruction
  • Early finish:
    • Finish here on a stage that was never generated, then Back to resume
    • Finish here on a stage that was generated
    • the summary and stepper states are correct in both cases
    • Done closes the modal
  • Recorded the footer and body buttons in every wizard state (input, clarifying questions, ready, generating, stage result, wireframes generating, last stage, finish). No flow action appears twice. No console errors.
  • Not tested with a real model. I did not check how well a real model picks screens, or whether it actually creates presented-by in the C4 stage. No AI provider was available.

🤖 Generated with Claude Code

…n bar

Mockups stage
- New Forge stage between Scenarios and C4 (requirements -> fitness ->
  scenarios -> mockups -> c4). Screens are part of the spec the
  architecture follows from, so they come before C4.
- The stage creates `mockup` nodes for the user-facing screens (skipping
  API-only behaviour, or creating none for a system with no UI), linked
  with `illustrates` (-> requirement / scenario) and `navigates-to`
  (-> mockup, labelled with the triggering user action).
- The C4 stage now takes the mockups into account and adds `presented-by`
  (mockup -> webapp / container), the same way it adds `constrains` for
  fitness functions once real elements exist.
- After the stage, "Generate N wireframes" draws a low-fi wireframe for
  every mockup without one, one call at a time (ai/mockupWireframe.ts),
  with progress, cancel, and tokens added to the session total.

Explicit early finish
- "Finish here" on every stage ends the run cleanly: whatever has been
  generated stays in the model and the wizard moves to the final step.
- The final step ("Finish", formerly "Export") summarises each stage
  (+N nodes / +M relations, or skipped) and keeps the .feature export.
- "<- Back" from an early finish resumes at the stage it was stopped at.
- The stepper ticks only stages that actually generated, marks skipped
  ones, and does not let the user jump to stages never reached.

Single action bar
- Flow actions (Generate, Regenerate, Cancel, Confirm answers / Skip
  questions, Continue / Finish) now live only in the modal footer, which
  shows whatever moves the current stage forward. Previously they were
  split between the stage body and the footer, e.g. an in-body Generate
  button next to a disabled footer Continue, and two different Cancels.
  The stage body keeps only per-item actions (Hub import, edit answers,
  generate wireframes, export).
- Fixes the stage progress panel showing during wireframe generation and
  "Edit answers" being clickable while a stage was generating.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tomasz-zajac-oss
tomasz-zajac-oss merged commit 8c6f198 into main Sep 23, 2026
2 checks passed
@tomasz-zajac-oss
tomasz-zajac-oss deleted the feature/forge-mockups branch September 23, 2026 19:03
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