🤖 tests: delete dead StatsTab, comparators, and test-only browser exports - #4472
Conversation
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 Test-audit cleanup: deletes browser exports whose only callers were tests and moves the StatsTab clear-error test onto the live TimingPanel path. |
|
@codex security review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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. |
…rts it normally (coder#4609) ## Summary `useVoiceInput` now 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-test `require("./useVoiceInput?test=<uuid>")`). Also drops a leftover stub for the deleted `useProjectGitStatuses` export. ## Background The module registered `keydown`/`keyup`/`blur` listeners on `window` at 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.tsx` had to load a fresh module per test, and a static import failed all 8 tests in the full browser suite (coder#4554). Fixes coder#4554. ## Implementation - The tracker is a per-hook ref updated by listeners added in a mount effect (`window` event 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. - Listener order is unchanged: the tracker is registered at mount, before the recording-only keybind listeners. - Behavior difference: Space presses before any `useVoiceInput` consumer mounts are no longer seen. The only consumer (`ChatInput`) mounts with the composer, long before a recording can start. - `MultiProjectGitStatusIndicator.test.tsx`: removes the `useProjectGitStatuses` entry from its store stub (the export was deleted in coder#4472). ## Validation - `useVoiceInput.test.tsx` with a static import: 8 pass alone and in the previously failing order `ProjectPage.autofocus → SelectableDiffRenderer.dragSelect → useVoiceInput` (12 pass). - Mutation: making the tracker never record a held Space fails "guest Space keyup cannot clear the host held-at-start guard". - Whole `bun test src/browser` in one process: 4279 pass, 0 fail. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high` • Cost: `$67.78`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high costs=67.78 -->
Summary
Deletes browser production code that only tests still called, and moves the tests that guarded live behavior onto the live code path. Part of the test-audit follow-up campaign (frontend area, WS7).
What was removed
StatsTabcomponent + its test-only_snapshot/_clearStatsprops anduseStatsDataoverridesStatsContainer(TimingPanel+ModelBreakdownPanel)StatsTab.clear.test.tsxreplaced byTimingPanel.clear.test.tsx, which drives the live path: realWorkspaceStorestats subscription +APIProviderclient whoseworkspace.stats.clearrejectscompareRecords,compareArrays(useStableReference.ts)compareMapsis used (App.tsx)closeSplit(rightSidebarLayout.ts)isActionableTaskExecutionStatusshouldRefreshInlineSkillSuggestionsgetAnthropicThinkingDisableReason+hasAnthropicThinkingSignatureuseProjectGitStatuses(GitStatusStore.ts)buildReviewDiffPathFilter,normalizeReviewPanelAssistedHunks(test-only wrappers inReviewPanel.tsx)buildReviewDiffPathFilterSpecs/getReviewPanelPathContext+normalizeAssistedReviewHunksdirectlygetReviewPanelPathContextis now exported)computeTaskAwaitPollGroupInfos(test-only wrapper)computeOperationalBundleInfos({ taskAwaitPollsOnly })/forkcases inparser.test.tsfork.test.tsRetained on purpose (test reset seams, not dead code):
__resetForTests(highlight worker),resetAiSelectionIntentForTests,overlayWorkspaceStoreRaw(test-support module).Validation
exportundersrc/browser(excluding stories) checked for non-test references acrosssrc/,tests/,vscode/,scripts/,.storybook/; orphan-module sweep found only the two HTML entry points.TimingPanel.clear.test.tsxfails whenhandleClearStatsstops setting the error (mutation check).bun teston RightSidebar, hooks/useStableReference, utils/{messages,agentSkills,ui,rightSidebarLayout}, stores/GitStatusStore: 1141 pass.make static-checkgreen.LOC: production +11 / −585; tests +134 / −355.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$4.21