Repository navigation
test(web): remove unreachable browser helper tests - #16773
t3-code-bot[bot] wants to merge 2 commits into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This PR removes 21 tests and five unreachable helper implementations; repository-wide references show the live navigation, viewport, and runtime-tab paths remain unchanged. It introduces no product-default, schema, deployment, or static-analysis changes, leaving only low-risk dead-code pruning. Notes:
You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
Dismissing prior approval to re-evaluate 7048e47
Dismissing prior approval to re-evaluate 7048e47
|
The wrapper removal looks focused, but please preserve the useful URL-construction coverage through Please adapt those cases to the reachable API, including its catch-and-return-raw-URL behavior for a public environment host, or point to equivalent existing coverage. This is a source-reviewed coverage gap, not a demonstrated runtime regression. I independently checked the pinned diff at |
problem
21 browser/preview tests exercise legacy helpers with no reachable production callers. they can pass while the shipped preview flow is broken. remove those complete tests, including two entire test files, along with their unused implementations, without changing reachable production behavior.
removal evidence
checked all tracked first-party files at base
b77108bc41for both the symbols and module paths, including imports/re-exports and namespace/property references. the five symbols below occur only in their defining production module and their direct tests; none has a production caller.apps/web/src/browser/browserRecordingScope.test.ts(5 tests).resolveBrowserRecordingStopTargetand its module have no production consumers. the currentPreviewView.tsx:160-165instead resolves the active runtime recording throughfindActiveBrowserRecordingRuntimeTabId;browserRecording.ts:234-242finds it by scoped thread and server tab. keepbrowserRecording.test.ts, including its live recording state/epoch replacement regression at lines 599-620.apps/web/src/components/preview/previewViewportRollback.test.ts(2 tests).shouldRollbackPreviewViewportand its module are never imported by production. these tests cannot detect any failure in the actual preview viewport commit path. retain the visible handler routing, cleanup, serialization and timeout regressions inbrowserViewportActions.test.ts, and allPreviewView.test.tsxcoverage.resolveBrowserNavigationTargettests frombrowserTargetResolver.test.ts. the export atbrowserTargetResolver.ts:63-76has no callers. explicit navigation goes throughPreviewView.tsx:229-256, while discovered URLs use the separateresolveDiscoveredServerUrlexport fromChatView.tsx,PreviewView.tsx,openDiscoveredPort.ts, anduseDiscoveredLocalServers.ts. keep every discovered-server test and both comprehensive host-classification boundary tests. importantly,resolveEnvironmentPortTargetstill has a real internal caller fromresolveDiscoveredServerUrl; neither that implementation nor its meaningful discovered-URL coverage was removed.browserViewportActions.test.ts.runBrowserViewportMutationhas no production caller. the shared internal queue remains covered through the actually usedcommitBrowserViewportChange, including pending-handler ordering and timeout serialization;useBrowserViewportResize.tsandPreviewView.tsxuse that path.previewRuntimeTabId.test.ts.isCurrentPreviewRuntimeTabhas no production caller. keep both tests for the actually usedpreviewRuntimeTabIdexport and the stronger epoch-replacement recording regression inbrowserRecording.test.ts.this is reachability-based pruning, not removal merely because tests are simple or implementation-specific. retained host-boundary tests have distinct cases beyond the canonical shared tests. no reachable production, provider, contract, mobile, or desktop behavior changes. the two orphaned modules and three unused exported helpers are deleted with their tests so knip does not require dead tests to keep dead code alive.
verification
origin/main(b77108bc41). the environment blocked destructive reset, so a new clean worktree was used instead of touching the previous checkout.vp install --frozen-lockfilepassed. install warned that local nodev26.5.1is outside the repo's^24.13.1engine.vp test run apps/web/src/browser/browserRecordingScope.test.ts apps/web/src/components/preview/previewViewportRollback.test.ts apps/web/src/browser/previewRuntimeTabId.test.ts apps/web/src/browser/browserViewportActions.test.ts apps/web/src/browser/browserTargetResolver.test.ts apps/web/src/browser/browserRecording.test.ts apps/web/src/components/preview/PreviewView.test.tsx apps/web/src/browser/desktopTabLifetime.test.tspassed: 8 files, 82 tests.vp run --filter @t3tools/web typecheckpassed (tsc --noEmit).vp lint apps/web/src/browser/browserTargetResolver.test.ts apps/web/src/browser/browserViewportActions.test.ts apps/web/src/browser/previewRuntimeTabId.test.tspassed.vp fmt --check apps/web/src/browser/browserTargetResolver.test.ts apps/web/src/browser/browserViewportActions.test.ts apps/web/src/browser/previewRuntimeTabId.test.tspassed.knip --workspace apps/web --include files,dependencies --no-config-hintsandknip --workspace apps/web --exports --preprocessor ./scripts/knip-schemas.ts --no-config-hintsboth passed after cleanup. reran the focused tests (6 files, 61 tests) and web typecheck successfully after the implementation cleanup.vp lintandvp fmt --checkpassed on all six remaining changed source/test files (browserTargetResolver,browserViewportActions,previewRuntimeTabId).git diff --checkpassed. reviewed the entire diff and added lines for accidental changes/secrets: 10 files changed, only unreachable implementation/test deletions and one import replacement. no repo-wide checks or browsers launched.created by the scheduled t3code useless test audit automation; bot-only commit, no human co-author.
model: gpt-6.1-sol. harness: hermes agent.