fix(intro): wire up redetector so "Change directory" stops hanging#441
Merged
kelsonpw merged 1 commit intokelsonpw/skills-html-stripfrom Apr 30, 2026
Merged
Conversation
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. |
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>
1306a9b to
50db6d1
Compare
4 tasks
kelsonpw
added a commit
that referenced
this pull request
Apr 30, 2026
) (#447) 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>
4 tasks
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
Fixes a hang where the IntroScreen's "Change directory" picker freezes after the user submits a new path.
Root cause
store.changeInstallDir(newDir)(insrc/ui/tui/store.ts) does the right thing on its end — resetsdetectionComplete=false, clears the framework config, and calls a registered redetector callback. The store has clean test coverage of this contract (src/ui/tui/__tests__/store.test.ts:1717-1803).The bug is on the production-wiring side.
src/commands/default.tsran framework detection as a one-shot inline IIFE that capturedinstallDirfrom closure. It never calledtui.store.setFrameworkRedetector(...). Result: when the user submits a new path, the spinner reappears (because state resets) but no detection ever runs, and the screen is stuck forever.Same gap meant
store.autoEnableInlineAddons('auto-tui')never fired in TUI mode either — that call lives insiderunFrameworkDetection(the helper extracted from bin.ts specifically so detection could be re-runnable), which had no production caller.Fix
Replace
default.ts's inline detection IIFE with the sharedrunFrameworkDetectionhelper, and wire up both store hooks the helper expects: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, so a stalesetDetectionComplete()from the old directory can't fire after the state reset.Net diff: -83 / +30 lines. The duplicated detection logic in default.ts (and its
FRAMEWORK_REGISTRY/detectAllFrameworks/DETECTION_TIMEOUT_MSdynamic imports) is gone.Test plan
pnpm test— 2469 tests pass / 14 skipped (the existingchangeInstallDir+setFrameworkRedetectorcontract tests atstore.test.ts:1717-1803are the regression coverage)pnpm lintcleanpnpm buildsucceeds; smoke test passes--install-dir=$RUN_BASELINEpointing at one project, then in the IntroScreen pick "Change directory" → type a different path → press Enter. Verify the spinner re-runs detection against the new tree and either auto-detects a framework or falls back to Generic. Repeat with rapid changes to confirm earlier detections don't stomp on later ones.Related
src/ui/tui/screens/IntroScreen.tsx:282-299— the PathInput that callsstore.changeInstallDir(absolutePath)src/ui/tui/store.ts:418-479—changeInstallDirimpl that fires the redetectorsrc/lib/framework-detection.ts:86-243— therunFrameworkDetectionhelper now wired upcc @amplitude/growth
🤖 Generated with Claude Code
Note
Low Risk
Documentation-only changes (skill prompts and reference markdown) with no runtime code paths affected; main risk is broken internal links or outdated doc guidance.
Overview
Updates the instrumentation workflow skills to reference the consolidated
taxonomyskill via the new relative path (../taxonomy/SKILL.md), replacing the older../../taxonomy/amplitude-quickstart-taxonomy-agent/...references.Tightens best-practices guidance by enumerating the full Amplitude Browser SDK Autocapture event exclusion list and warning against conceptual duplicates.
Refreshes integration reference materials by replacing large embedded HTML documentation snapshots (e.g., Android and Quickstart) with much smaller markdown excerpts and adjusts a few reference labels (Android/Angular) for clarity.
Reviewed by Cursor Bugbot for commit 50db6d1. Bugbot is set up for automated code reviews on this repo. Configure here.