feat(web): convert Blueprint Builder to 4-step wizard#2
Conversation
There was a problem hiding this comment.
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.
| const blob = await generateArchive(scaffold.files, scaffold.format, projectName); | ||
| downloadArchive(blob, `${projectName || "stackfast-app"}.${scaffold.format}`); |
There was a problem hiding this comment.
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>
| 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}`); |
| {step === "results" && blueprint && ( | ||
| <div className="space-y-6"> | ||
| <BlueprintOutputCard blueprint={blueprint} /> | ||
| </div> | ||
| )} |
There was a problem hiding this comment.
🟡 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.
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
80cd627 to
2732880
Compare
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
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
BlueprintRequestschema — previously unused)BlueprintOutputCardrendered inside the wizardPOST /api/v1/scaffoldswith project name input, file list preview, warnings panel, and client-side ZIP download via the existingarchive-generatorUX
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:
Quality gate (local)
pnpm -r type-check— 0 errorspnpm -r lint— 0 errorspnpm -r test— 60 unit/API tests passpnpm -r build— web + api + packagespnpm test:e2e— 4/4 passedNotes
explainStack + generateRoadmap + per-alternative tradeoffs + whyNot).summarizeTradeoffsreturned >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.
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.
BlueprintRequest) → Results → Export (POST /api/v1/scaffolds; project name used for archive andpackage.json; file list + applied recipe count + generated timestamp; warnings; client-side ZIP viaarchive-generator).tests/e2e/mvp-flows.spec.tswalks 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.