Skip to content

🤖 tests: delete dead StatsTab, comparators, and test-only browser exports - #4472

Merged
ThomasK33 merged 3 commits into
mainfrom
test-audit/ws7-1-dead-code
Sep 25, 2026
Merged

ThomasK33 merged 3 commits into
mainfrom
test-audit/ws7-1-dead-code

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

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

Removed Why it was dead What happened to its tests
StatsTab component + its test-only _snapshot/_clearStats props and useStatsData overrides No production caller since #2729 moved the Stats tab to StatsContainer (TimingPanel + ModelBreakdownPanel) StatsTab.clear.test.tsx replaced by TimingPanel.clear.test.tsx, which drives the live path: real WorkspaceStore stats subscription + APIProvider client whose workspace.stats.clear rejects
compareRecords, compareArrays (useStableReference.ts) Only compareMaps is used (App.tsx) 12 comparator tests deleted; stale "tested manually via useUnreadTracking…" comments fixed
closeSplit (rightSidebarLayout.ts) Never called in production since #1340 Test deleted
isActionableTaskExecutionStatus Last caller removed in #4341 No tests
shouldRefreshInlineSkillSuggestions #4013 made inline suggestions synchronously derived, so there is no refresh gate Tests deleted
getAnthropicThinkingDisableReason + hasAnthropicThinkingSignature #1450 stopped disabling Anthropic thinking Tests deleted; the one transform test that used it as an oracle now asserts the preserved signature directly
useProjectGitStatuses (GitStatusStore.ts) No production caller None in CI
buildReviewDiffPathFilter, normalizeReviewPanelAssistedHunks (test-only wrappers in ReviewPanel.tsx) Production calls buildReviewDiffPathFilterSpecs / getReviewPanelPathContext + normalizeAssistedReviewHunks directly Tests retargeted to those production functions (getReviewPanelPathContext is now exported)
computeTaskAwaitPollGroupInfos (test-only wrapper) ChatPane calls computeOperationalBundleInfos({ taskAwaitPollsOnly }) Tests use a local fixture helper around the production function
2 /fork cases in parser.test.ts Same contract and name as fork.test.ts Deleted

Retained on purpose (test reset seams, not dead code): __resetForTests (highlight worker), resetAiSelectionIntentForTests, overlayWorkspaceStoreRaw (test-support module).

Validation

  • Sweep: every export under src/browser (excluding stories) checked for non-test references across src/, tests/, vscode/, scripts/, .storybook/; orphan-module sweep found only the two HTML entry points.
  • TimingPanel.clear.test.tsx fails when handleClearStats stops setting the error (mutation check).
  • bun test on RightSidebar, hooks/useStableReference, utils/{messages,agentSkills,ui,rightSidebarLayout}, stores/GitStatusStore: 1141 pass.
  • make static-check green.

LOC: production +11 / −585; tests +134 / −355.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $4.21

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T08:49:21.747956Z 9a0fb63 Manual request
🔒 Security Review ✅ Completed 2026-09-25T08:49:25.986341Z 9a0fb63 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ThomasK33

Copy link
Copy Markdown
Member Author

@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.

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 9a0fb63fc6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 9a0fb63fc6

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 added this pull request to stack #4495 September 25, 2026 09:09
@ThomasK33
ThomasK33 added this pull request to the merge queue Sep 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 25, 2026
@ThomasK33
ThomasK33 added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit 7c133d0 Sep 25, 2026
31 checks passed
@ThomasK33
ThomasK33 deleted the test-audit/ws7-1-dead-code branch September 25, 2026 09:56
azaj01 pushed a commit to azaj01/mux that referenced this pull request Sep 26, 2026
…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 -->
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