Remove dead code: unreferenced files and unused exports - #807
Merged
Conversation
A repo-wide dead-code scan found two modules with zero importers and a handful of exports whose only occurrence in the repo is the export site. All are pure deletions — no call sites, no behavior change. Deleted files: - apps/web/src/lib/hotkeys/format.ts (91 lines) — nothing imports `hotkeys/format`; its five exports only referenced each other. - apps/web/src/components/app/dashboard-navigation.ts — sole export `openAgentFromJobs` was never called. Removed unused exports: - `DocsPane` (docs-pane.tsx) — the file is imported only for `DocsContent`/`DOCS_SECTION_NAV`; the dialog wrapper is never rendered. Its `DocsPaneProps` type and the now-orphaned radix/lucide imports go with it. - `SettingsPaneProps` (settings-pane.tsx) — leftover from a component that no longer exists. - `useBrainObject`, `useAgentBrainActivity` and the orphaned `BrainAgentActivity` type (use-brain.ts). - `reviewVerdictLabel` + `ReviewVerdict` (agent-event-utils.ts). - `ReleaseJobType` (use-release-stream.ts). - `isMcpRoute` (auth.ts) — `isScopedMcpRoute` is the one in use. - `ASSISTED_UPDATE_STORE_PATH` (assisted-update-store.ts) — self-described as a back-compat alias for callers that no longer exist, and it resolved the home directory at module load. - `PinInput` type (shared/mcp/server.ts). Deliberately out of scope: unused vendored shadcn primitives (components/ui/sheet.tsx, DialogTrigger, SelectGroup, …) and the five unused tokens in lib/glass.ts — those are design-system surface area rather than dead application code, and are queued for a separate call. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
selfcontained added a commit
that referenced
this pull request
Aug 12, 2026
Three buckets of unreferenced design-system code have been deferred twice (PR #807, PR #934) because they are a judgement call rather than clear-cut dead application code. This settles the policy and applies it. Delete what is dead weight: - apps/web/src/components/ui/sheet.tsx (134 lines, zero importers) - five unused tokens in lib/glass.ts (glassDivider, glassHover, glassActive, glassBadgeBg, primaryGlow) Keep, and say so in a comment, what is a deliberately complete vendored API surface: DialogTrigger/DialogClose in ui/dialog.tsx and SelectGroup/SelectLabel/SelectSeparator in ui/select.tsx. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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 freeto 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.
What
A repo-wide dead-code scan (dead code / duplication / oversized-file audit — the backlog was empty, so this run started fresh). This PR is the pure-deletion slice: 243 lines removed, zero behavior change.
Deleted files (zero importers anywhere in
apps/,e2e/,bin/,scripts/, tests):apps/web/src/lib/hotkeys/format.ts(91 lines) — nothing importshotkeys/format; its five exports (formatCombo,formatComboParts,formatHotkey,formatHotkeyParts,formatHotkeyForKbd) only referenced each other.apps/web/src/components/app/dashboard-navigation.ts— sole exportopenAgentFromJobswas never called.Removed unused exports (only occurrence in the repo was the export site):
DocsPane+DocsPanePropsapps/web/src/components/app/docs-pane.tsxSettingsPanePropsapps/web/src/components/app/settings-pane.tsxuseBrainObject,useAgentBrainActivity,BrainAgentActivityapps/web/src/hooks/use-brain.tsreviewVerdictLabel,ReviewVerdictapps/web/src/components/app/agent-event-utils.tsReleaseJobTypeapps/web/src/hooks/use-release-stream.tsisMcpRouteapps/server/src/auth.tsASSISTED_UPDATE_STORE_PATHapps/server/src/assisted-update-store.tsPinInputapps/server/src/shared/mcp/server.tsNotes on two of these:
docs-pane.tsxis imported — but only forDocsContent/DOCS_SECTION_NAVbysettings-pane.tsx. TheDocsPanedialog wrapper itself is never rendered; removing it also orphaned the@radix-ui/react-dialogandXimports.ASSISTED_UPDATE_STORE_PATHwas self-described in a comment as a back-compat alias "for callers that imported the constant" — there are none, and it eagerly resolved the home directory at module load.isScopedMcpRoute(the sibling that is used) is untouched.Why this is tech debt
Unreferenced modules and exports are surface area that has to be read, type-checked, and reasoned about on every pass through these files, and they make future dead-code scans noisier. Nothing here changes runtime behavior — every deletion was verified to have no remaining reference.
Explicitly out of scope
components/ui/sheet.tsx,DialogTrigger,DialogClose,SelectGroup,SelectLabel,SelectSeparator) and the five unused tokens inlib/glass.ts. These are design-system surface area, not dead application code — removing them is a judgement call, so they're queued in the backlog instead.recordErrorinlib/energy-metrics.ts— dead, but removing it also orphans theerrorsfield on theEnergyMetricsshape; needs its own pass.Validation
pnpm run check— passpnpm run finalize:web— passpnpm run test— 131 + 24 + 8 files pass, 2604 testspnpm run test:e2e— 169 passed, 12 skippedQueued for the next run
The audit also produced 24 verified duplication findings that seeded the backlog. Top of the queue: four byte-identical server helpers (
isUniqueViolation×3,sleep×2,isAgentLatestEventType×2,escapeLike×2) to consolidate intoapps/server/src/shared/lib/, thenshortPath×4 in web, then the ~180-line review-feedback card duplicated betweendiff-annotations.tsxandreviews-sidebar.tsx.🤖 Generated with Claude Code