Skip to content

feat: choose-your-path onboarding wizard with real API calls#1189

Draft
simple-agent-manager[bot] wants to merge 10 commits into
mainfrom
sam/really-choose-path-onboarding-01kt56
Draft

feat: choose-your-path onboarding wizard with real API calls#1189
simple-agent-manager[bot] wants to merge 10 commits into
mainfrom
sam/really-choose-path-onboarding-01kt56

Conversation

@simple-agent-manager
Copy link
Copy Markdown
Contributor

Summary

Replaces the tab-based onboarding wizard with a TurboTax-style question-driven flow that personalizes the setup experience based on user answers.

Flow

  1. Questions — AI subscription type, cloud account, GitHub readiness (4 branching questions)
  2. Path Preview — personalized setup plan with time estimate and step details
  3. Step Execution — real API calls for each setup step (credential validation, GitHub App install, project creation)
  4. Completion — success screen with next-steps guidance

What's real (not mocked)

  • API key validation + save via validateAgentCredential / saveAgentCredential
  • Hetzner token validation + save via validateCredential / createCredential
  • GitHub App installation redirect via getGitHubInstallUrl
  • Repository listing via listGitHubInstallations / listRepositories
  • Project creation via createProject
  • Existing setup detection (auto-dismisses if already configured)

Accessibility

  • role="radiogroup" + aria-checked on question options
  • aria-live region for phase transition announcements
  • role="progressbar" with full ARIA attributes
  • Proper <label> elements on all form inputs
  • 44px minimum touch targets on interactive elements

Files

  • choose-path/ChoosePathWizard.tsx — main orchestrator (258 lines)
  • choose-path/questions.ts — question definitions with branching
  • choose-path/path-generator.ts — tag-based step generation
  • choose-path/QuestionCard.tsx — accessible question UI
  • choose-path/PathPreview.tsx — step preview with time estimates
  • choose-path/StepExecution.tsx — step forms with real API calls
  • choose-path/ProjectSelector.tsx — repo picker component
  • choose-path/step-actions.ts — API call execution logic
  • choose-path/CompletionScreen.tsx — success screen

🤖 Generated with Claude Code

raphaeltm and others added 10 commits June 2, 2026 22:47
Replace tab-based onboarding with a TurboTax-style question-driven flow:
- Questions phase: AI subscription, cloud account, GitHub readiness
- Path preview: personalized setup plan based on answers
- Step execution: real API calls for credential validation, GitHub install, project creation
- Completion: success screen with next-steps guidance

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix setState during render: use useEffect for auto-select and repo loading
- Fix stale closures: use functional updaters in handleAnswer/handleBack
- Deduplicate tags to prevent accumulation on remount
- Validate selectedRepo exists before createProject
- Fix misleading action labels: ai-oauth and ai-sam steps now say "Continue"
- Fix template path: navigate to /projects instead of broken createProject call
- Split StepExecution.tsx into step-actions.ts and ProjectSelector.tsx (file size)
- Fix missing space in template literal for error messages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add role="radiogroup" + aria-checked on question option buttons
- Add aria-live region for phase transition announcements
- Add role="region" to wizard container
- Add progressbar ARIA attributes (valuenow, valuemin, valuemax, label)
- Add proper labels to all form inputs (API key, Hetzner token, repo select)
- Replace raw <select> with Select component from design system
- Remove internal tag debug output from PathPreview
- Fix step numbering: skip auto-handled steps in numbering
- Filter auto-handled steps from execution phase
- Use sam-type-section-heading instead of page-title for widget headings
- Add loading skeleton during initial status check
- Add min-h-[44px] to header buttons for touch target compliance
- Fix getTimeEstimate "~0 mins" edge case
- Rename "Done" badge to "Handled" for clarity
- Simplify question counter (removed misleading "of ~4")

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- GitHub App install opens in new tab instead of navigating away,
  preserving wizard state. Polls for installation completion every 3s.
- Completion screen adds explicit Dismiss button and dismisses on
  "Go to my projects" click so the wizard card disappears.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- existing-* tags now mark steps as optional in path-generator,
  so returning users skip already-completed setup steps
- Refactor handleAnswer to avoid nested setState inside updater
- Store and clean up GitHub poll timeout on unmount
- aria-live region announces question text during question phase
- Fix ai-oauth step details to not promise a redirect
- Template project path calls onSkip to properly dismiss wizard

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add `?? []` guard in `listAgentProfiles()` to prevent crash when API
  returns unexpected shape (fixes React error on project page load after
  onboarding wizard creates a new project)
- Add Playwright recording spec for 7 onboarding scenarios × 2 viewports
  (14 videos uploaded to SAM library under /onboarding-wizard-recordings/)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review findings addressed:
- CRITICAL: Template path never dismissed wizard — onSkip was always
  undefined for the project step. Now passes onDismiss directly.
- CRITICAL: handleCreateProject double-navigation — removed competing
  setTimeout; dismiss wizard and navigate directly to project.
- CRITICAL: GitHub poll double-click leaked intervals — clear existing
  poll before starting new one.
- CRITICAL: QuestionCard used invalid role="radio" on <button> —
  replaced with aria-pressed on plain buttons.
- HIGH: GitHub poll timeout was silent — now sets error message with
  retry prompt after 5 minutes.
- HIGH: No focus management on transitions — added ref-based focus
  to phase content area and step headings.
- HIGH: text-[10px] below minimum readable size — replaced with text-xs.
- HIGH: text-fg-muted/30 and /40 failed WCAG contrast — raised to
  text-fg-muted for all instances.
- HIGH: Touch targets below 44px — fixed "Show details" button and
  agent selector buttons.
- HIGH: Select not disabled during project creation — added disabled
  prop during loading.
- MEDIUM: Promise.all lost partial results on single failure —
  replaced with Promise.allSettled.
- Removed broken old test files (OnboardingWizard.test.tsx and
  onboarding-wizard-audit.spec.ts) that tested the replaced tab-based
  wizard.
- Added aria-hidden to decorative "S" badge.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- questions.test.ts: validates graph structure (no cycles, all reachable,
  all paths terminate), content integrity (non-empty fields, terminal tags),
  and full path enumeration (16 paths confirmed)
- step-actions.test.ts: validates validation-before-save invariant for
  both ai-apikey and cloud-hetzner steps, input trimming, error messages,
  fallback messages, and pass-through step behavior
- path-generator.test.ts: already committed in previous batch

56 tests across 3 files, all passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Critical fixes:
- Fix TS2304: onDismiss was not in StepForm scope — add to StepFormProps
  and pass through from StepExecution (template path was completely broken)
- Fix tag race condition: handleAnswer now uses functional updater for
  setTags to prevent checkStatus effect from overwriting existing-* tags
- Remove dead onSkip prop from ProjectSelector (replaced by onDismiss)

High fixes:
- Add aria-expanded to "Show details" disclosure button
- Add aria-pressed to agent selector buttons in ai-apikey step
- Fix first-step focus: remove > 0 guard so heading gets focus on mount
- Change QuestionCard container from role="list" to role="group"
  (buttons are not valid listitem children)

Medium fixes:
- Add aria-hidden to pipe separators in PathPreview stats
- Add min-h-[44px] touch target to "Change my answers" button
- Use semantic <ol>/<li> for CompletionScreen "What's next" list
- Add aria-hidden to ArrowLeft icon in Back button

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 3, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
5.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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