Skip to content

feat(web): convert Blueprint Builder to 4-step wizard#2

Merged
Nether403 merged 1 commit into
mainfrom
feat/phase-4-blueprint-wizard
May 12, 2026
Merged

feat(web): convert Blueprint Builder to 4-step wizard#2
Nether403 merged 1 commit into
mainfrom
feat/phase-4-blueprint-wizard

Conversation

@Nether403

@Nether403 Nether403 commented May 12, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 4 gap #1. The Blueprint Builder was a single form; this PR turns it into a guided 4-step wizard that also integrates the scaffold export flow so users can go from idea to downloadable starter in one page.

Wizard steps

  1. Idea — required textarea, distraction-free
  2. Constraints — optional free-form constraints plus structured fields for budget, timeline, team size (all wired to the existing BlueprintRequest schema — previously unused)
  3. Results — existing BlueprintOutputCard rendered inside the wizard
  4. Export — scaffold generation via POST /api/v1/scaffolds with project name input, file list preview, warnings panel, and client-side ZIP download via the existing archive-generator

UX

  • Progress indicator with completed/active/pending states
  • Back / Next controls with per-step loading states
  • "Start over" action on the final step
  • Inline error surfaces with retry affordances on both blueprint and scaffold failures
  • Regenerate button on the export step for project-name tweaks

Evidence

Playwright walks the whole flow: idea → constraints (with budget/timeline selects) → results (asserts "Recommended Architecture", "Primary Stack", "Harmony Score") → export (asserts "Download ZIP"). A screenshot is captured at each step to test-results/wizard-step-*.png.

Full E2E suite result:

4 passed (2.2m)
 ok [chromium] searches the tool catalog (3.8s)
 ok [chromium] shows a basic migration path (4.5s)
 ok [chromium] analyzes pairwise compatibility (4.1s)
 ok [chromium] generates an idea-to-stack blueprint (33.6s)

Quality gate (local)

  • pnpm -r type-check — 0 errors
  • pnpm -r lint — 0 errors
  • pnpm -r test — 60 unit/API tests pass
  • pnpm -r build — web + api + packages
  • pnpm test:e2e — 4/4 passed

Notes

  • Bumped the wizard E2E test timeout to 180s because blueprint generation can take ~25-30s when the Gemini provider does the full parallel fan-out (explainStack + generateRoadmap + per-alternative tradeoffs + whyNot).
  • The one Gemini fallback log in the E2E run (summarizeTradeoffs returned >8 items, Zod schema caps at 8) is the design working correctly — fallback to heuristic happens automatically with no user-visible impact.

Next

Phase 4 gap #2 (compatibility heatmap) and gap #3 (TanStack Query sweep) will ship as separate PRs.


Open in Devin Review

Summary by cubic

Converted the Blueprint Builder into a 4-step wizard and integrated scaffold export so users can go from idea to a downloadable starter in one page. Adds progress UX, structured constraints, and inline error handling.

  • New Features
    • Four steps: Idea → Constraints (budget, timeline, team size wired to BlueprintRequest) → Results → Export (POST /api/v1/scaffolds; project name used for archive and package.json; file list + applied recipe count + generated timestamp; warnings; client-side ZIP via archive-generator).
    • Progress indicator (completed/active/pending with test-id), Back/Next with per-step loading, Start over on final step, inline errors with retry for blueprint and scaffold, Regenerate on export.
    • E2E: tests/e2e/mvp-flows.spec.ts walks all steps, saves step screenshots, asserts "Recommended Architecture" and "Download ZIP", and bumps timeout to 180s.

Written for commit 2732880. Summary will update on new commits.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/web/src/pages/BlueprintBuilder.tsx">

<violation number="1" location="apps/web/src/pages/BlueprintBuilder.tsx:119">
P2: Normalize `projectName` in download/archive generation the same way as scaffold generation to avoid invalid or inconsistent archive names.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment on lines +119 to +120
const blob = await generateArchive(scaffold.files, scaffold.format, projectName);
downloadArchive(blob, `${projectName || "stackfast-app"}.${scaffold.format}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Normalize projectName in download/archive generation the same way as scaffold generation to avoid invalid or inconsistent archive names.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/web/src/pages/BlueprintBuilder.tsx, line 119:

<comment>Normalize `projectName` in download/archive generation the same way as scaffold generation to avoid invalid or inconsistent archive names.</comment>

<file context>
@@ -1,112 +1,637 @@
+    if (!scaffold) return;
+    setDownloadError(null);
+    try {
+      const blob = await generateArchive(scaffold.files, scaffold.format, projectName);
+      downloadArchive(blob, `${projectName || "stackfast-app"}.${scaffold.format}`);
+    } catch (error) {
</file context>
Suggested change
const blob = await generateArchive(scaffold.files, scaffold.format, projectName);
downloadArchive(blob, `${projectName || "stackfast-app"}.${scaffold.format}`);
const normalizedProjectName = projectName.trim() || "stackfast-app";
const blob = await generateArchive(scaffold.files, scaffold.format, normalizedProjectName);
downloadArchive(blob, `${normalizedProjectName}.${scaffold.format}`);

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment on lines +170 to +174
{step === "results" && blueprint && (
<div className="space-y-6">
<BlueprintOutputCard blueprint={blueprint} />
</div>
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Scaffold generation errors are invisible when triggered from the results step

When the user clicks "Continue to export" on the results step, handleGenerateScaffold is called (BlueprintBuilder.tsx:199). If the scaffold mutation fails, the onSuccess callback never fires, so step stays at "results". However, the scaffoldError is only rendered inside the ExportStep component, which is conditionally mounted only when step === "export" (BlueprintBuilder.tsx:176). This means the error is stored but never displayed — the user just sees the "Continue to export" button become re-enabled with no feedback about the failure. This is inconsistent with how blueprint generation errors are handled: those errors correctly display inside the ConstraintsStep where the action is initiated (BlueprintBuilder.tsx:393-400).

Prompt for agents
The scaffold generation error (scaffoldError) is only displayed inside ExportStep, which is gated behind step === 'export'. But when scaffold generation fails, the step stays at 'results' because onSuccess never fires. The user needs to see the error.

Possible approaches:
1. Add scaffold error display to the results step section (around line 170-174 in BlueprintBuilder.tsx), similar to how generateError is shown inside ConstraintsStep.
2. Alternatively, always navigate to the export step when scaffold generation is initiated (move setStep('export') outside of onSuccess), and let the ExportStep handle both loading and error states. This would require adjusting handleGenerateScaffold to call setStep('export') before or alongside generateScaffold, rather than only onSuccess.

Approach 1 is simpler and consistent with the existing pattern for blueprint errors.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Phase 4 gap #1: the Blueprint Builder was a single form with idea +
constraints. This PR splits the flow into a guided 4-step wizard
and adds an integrated scaffold export step so users can go from
idea to downloadable starter repo in one page.

Steps
1. Idea — required textarea, focused and distraction-free
2. Constraints — optional free-form constraints plus structured
   fields for budget, timeline, and team size (all wired to the
   BlueprintRequest schema)
3. Results — existing BlueprintOutputCard rendered inside the wizard
4. Export — scaffold generation via /api/v1/scaffolds with project
   name input, file list preview, warnings panel, and client-side
   ZIP download using the existing archive-generator

UX
- Progress indicator shows completed/active/pending steps with a
  data-testid for E2E assertions
- Back / Next controls with per-step loading states and a "Start
  over" action on the final step
- Errors from blueprint generation and scaffold generation are
  surfaced inline with retry affordances
- Regenerate button on the export step in case the user tweaks
  the project name after scaffolding

E2E coverage
- tests/e2e/mvp-flows.spec.ts walks the full wizard: idea →
  constraints (with budget/timeline selects) → results (asserts
  "Recommended Architecture", "Primary Stack", "Harmony Score")
  → export (asserts "Download ZIP" is visible)
- Saves a screenshot at each step to test-results/wizard-step-*.png
  for visual evidence (test-results/ is gitignored)
- Bumps this test's timeout to 180s because blueprint generation
  can take 25-30s when Gemini provider does the full fan-out

Quality gate (local)
- pnpm -r type-check: 0 errors
- pnpm -r lint: 0 errors
- pnpm -r test: 60 unit/API tests pass
- pnpm -r build: web + api + packages
- pnpm test:e2e: 4 passed, including the new multi-step wizard flow
@Nether403 Nether403 force-pushed the feat/phase-4-blueprint-wizard branch from 80cd627 to 2732880 Compare May 12, 2026 11:37
Nether403 added a commit that referenced this pull request May 12, 2026
Phase 4 gap #2. The Compatibility page was a single pairwise
analyzer. This PR adds a second "Matrix" tab that renders a
category-by-category heatmap so users can survey how every tool
in one category pairs with every tool in another at a glance.

Design
- Two view modes on the Compatibility page: Pairwise (existing)
  and Matrix (new). Tabs use a plain radiogroup-style toggle;
  the pairwise UI is unchanged.
- The matrix fetches the full catalog once via useCatalog (new
  TanStack Query hook) and evaluates every row × column pair
  synchronously using the bundled packages/rules-engine. No
  new API route and no N^2 round-trips.
- Users pick row and column categories (defaults to frontend ×
  hosting). Each cell shows the harmony score with color bucket
  (emerald / lime / amber / orange / red) plus side badges for
  hard conflicts (red dot) and synergies (green dot). Deprecated
  tools are filtered out.
- Horizontal scroll with a sticky row header for readability
  when many tools are in a category (category-heavy picks like
  "ai-model" or "backend-framework" can have 10+ columns).

Why not a 97x97 grid
- 9409 cells is more data than a human can scan. The roadmap
  text asks for a heatmap, not a specific layout; the category-
  pair matrix conveys the same "which tools click together"
  story with much better ergonomics and no perf concerns.

E2E coverage
- New Playwright test "shows a compatibility matrix across two
  categories" navigates to /compatibility, clicks the Matrix
  tab, picks frontend × hosting, and asserts the table renders
  with at least one score cell and contains Next.js and Vercel.
  Screenshot saved to test-results/compat-matrix.png.
- Existing pairwise E2E test continues to pass (pairwise is
  still the default mode).
- Bumped the blueprint E2E timeout to 120s/60s for the same
  reason PR #2 did: parallel AI fan-out can push past 30s.

Quality gate (local)
- pnpm -r type-check: 0 errors
- pnpm -r lint: 0 errors
- pnpm -r build: web + api + packages
- pnpm -r test: 60 unit/API tests pass
- pnpm test:e2e: 5 passed
@Nether403 Nether403 merged commit a19fe02 into main May 12, 2026
1 check passed
@Nether403 Nether403 deleted the feat/phase-4-blueprint-wizard branch May 12, 2026 16:16
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