Skip to content

fix(intro): wire up redetector so "Change directory" stops hanging#447

Merged
kelsonpw merged 1 commit intomainfrom
kelsonpw/wire-redetector
Apr 30, 2026
Merged

fix(intro): wire up redetector so "Change directory" stops hanging#447
kelsonpw merged 1 commit intomainfrom
kelsonpw/wire-redetector

Conversation

@kelsonpw
Copy link
Copy Markdown
Collaborator

@kelsonpw kelsonpw commented Apr 30, 2026

Summary

Re-targets the redetector wiring fix from PR #441 onto main. PR #441 was merged into the kelsonpw/skills-html-strip branch (PR #430, the large skill refresh) instead of main, so the fix isn't reaching users until that 130+ file PR lands. This separate PR lets the small, important bug fix land independently.

The fix replaces the inline framework-detection wiring in src/commands/default.ts with a call to the existing shared helper runFrameworkDetection from src/lib/framework-detection.ts, and wires up setFrameworkRedetector so the IntroScreen's "Change directory" picker can actually re-trigger detection on the new path. Without this, store.changeInstallDir(newDir) resets detectionComplete=false but the spinner sat there forever.

Pure refactor + missing-wire fix — 30 lines added, 83 removed, single file. No semantic change to the detection logic itself; the helper is the same one CI/agent modes already use.

Test plan

  • pnpm build — clean
  • pnpm lint — clean
  • pnpm test — 2531 pass, 6 unrelated failures in DataIngestionCheckScreen.tracking-plan.test.tsx (pre-existing flaky/timing-sensitive tests, not touched by this PR)
  • Manual: launch wizard, switch directories from IntroScreen, confirm detection re-runs and outro screen advances

Related

🤖 Generated with Claude Code


Note

Medium Risk
Changes the TUI startup/framework-detection wiring, including abort/cancellation behavior, which can affect wizard progression and feature discovery when users switch directories mid-run.

Overview
Fixes the IntroScreen “Change directory” flow by wiring framework re-detection to the shared runFrameworkDetection helper instead of the previous inline detection logic.

The TUI now registers a redetector callback and tracks the initial detection with an AbortController, so switching directories cancels in-flight scans and reliably re-runs detection/feature discovery without leaving the UI stuck on the detection spinner.

Reviewed by Cursor Bugbot for commit 35f9967. Bugbot is set up for automated code reviews on this repo. Configure here.

)

The IntroScreen's "Change directory" picker freezes after the user
submits a new path. `store.changeInstallDir(newDir)` resets
`detectionComplete = false` (so the spinner reappears) and then
fires the registered redetector callback — but in production the
redetector was never registered, so the spinner spun forever.

Same gap meant `store.autoEnableInlineAddons('auto-tui')` never
fired in TUI mode. It's only called inside `runFrameworkDetection`,
the helper extracted from bin.ts for re-runnability — and that
helper had no production caller.

`default.ts`'s detection task ran inline as a one-shot IIFE that
captured `installDir` from closure and never offered cancellation
or re-run. This commit replaces the inline version with the shared
`runFrameworkDetection` helper and wires up both:

  - `setFrameworkRedetector(...)` — closes the IntroScreen loop so
    submitting a new path actually re-runs detection against it.
  - `registerActiveDetection(controller)` — lets a directory swap
    that lands mid-detection cancel the in-flight run instead of
    leaving a stale `setDetectionComplete()` to fire after the
    state reset.

Removes ~83 lines of duplicated detection logic from default.ts
and drops the `FRAMEWORK_REGISTRY` / `detectAllFrameworks` /
`DETECTION_TIMEOUT_MS` dynamic imports that fed it.

Existing store tests at `src/ui/tui/__tests__/store.test.ts` already
cover the `changeInstallDir` + redetector contract end-to-end
(lines 1717-1803). All 2469 tests pass.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kelsonpw kelsonpw requested a review from a team as a code owner April 30, 2026 06:11
@github-actions
Copy link
Copy Markdown
Contributor

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci django
  • /wizard-ci fastapi
  • /wizard-ci flask
  • /wizard-ci javascript-node
  • /wizard-ci javascript-web
  • /wizard-ci next-js
  • /wizard-ci python
  • /wizard-ci react-router
  • /wizard-ci vue

Test an individual app:

  • /wizard-ci django/django3-saas
  • /wizard-ci fastapi/fastapi3-ai-saas
  • /wizard-ci flask/flask3-social-media
Show more apps
  • /wizard-ci javascript-node/express-todo
  • /wizard-ci javascript-node/fastify-blog
  • /wizard-ci javascript-node/hono-links
  • /wizard-ci javascript-node/koa-notes
  • /wizard-ci javascript-node/native-http-contacts
  • /wizard-ci javascript-web/saas-dashboard
  • /wizard-ci next-js/15-app-router-saas
  • /wizard-ci next-js/15-app-router-todo
  • /wizard-ci next-js/15-pages-router-saas
  • /wizard-ci next-js/15-pages-router-todo
  • /wizard-ci python/meeting-summarizer
  • /wizard-ci react-router/react-router-v7-project
  • /wizard-ci react-router/rrv7-starter
  • /wizard-ci react-router/saas-template
  • /wizard-ci react-router/shopper
  • /wizard-ci vue/movies

Results will be posted here when complete.

@kelsonpw kelsonpw merged commit b3a6ed3 into main Apr 30, 2026
13 checks passed
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