fix(intro): wire up redetector so "Change directory" stops hanging#447
Merged
fix(intro): wire up redetector so "Change directory" stops hanging#447
Conversation
) 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>
Contributor
🧙 Wizard CIRun 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:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Re-targets the redetector wiring fix from PR #441 onto
main. PR #441 was merged into thekelsonpw/skills-html-stripbranch (PR #430, the large skill refresh) instead ofmain, 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.tswith a call to the existing shared helperrunFrameworkDetectionfromsrc/lib/framework-detection.ts, and wires upsetFrameworkRedetectorso the IntroScreen's "Change directory" picker can actually re-trigger detection on the new path. Without this,store.changeInstallDir(newDir)resetsdetectionComplete=falsebut 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— cleanpnpm lint— cleanpnpm test— 2531 pass, 6 unrelated failures inDataIngestionCheckScreen.tracking-plan.test.tsx(pre-existing flaky/timing-sensitive tests, not touched by this PR)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
runFrameworkDetectionhelper 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.