🤖 fix: attach useVoiceInput's key listeners on mount so its test imports it normally - #4609
Conversation
|
@codex review |
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
useVoiceInputnow attaches its Space-held tracking listeners when the hook mounts instead of when the module is first evaluated, so its test imports the hook normally (no per-testrequire("./useVoiceInput?test=<uuid>")). Also drops a leftover stub for the deleteduseProjectGitStatusesexport.Background
The module registered
keydown/keyup/blurlisteners onwindowat load time. One process-wide instance therefore stayed bound to whichever window existed when some file first imported it (or to none if that happened without a DOM).useVoiceInput.test.tsxhad to load a fresh module per test, and a static import failed all 8 tests in the full browser suite (#4554). Fixes #4554.Implementation
windowevent subscriptions are an external system, so an effect is appropriate) and removed on unmount. The recording-keybind effect reads that ref where it used to read the module variable.useVoiceInputconsumer mounts are no longer seen. The only consumer (ChatInput) mounts with the composer, long before a recording can start.MultiProjectGitStatusIndicator.test.tsx: removes theuseProjectGitStatusesentry from its store stub (the export was deleted in 🤖 tests: delete dead StatsTab, comparators, and test-only browser exports #4472).Validation
useVoiceInput.test.tsxwith a static import: 8 pass alone and in the previously failing orderProjectPage.autofocus → SelectableDiffRenderer.dragSelect → useVoiceInput(12 pass).bun test src/browserin one process: 4279 pass, 0 fail.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$67.78