Skip to content

chore: remove dead code - #4625

Merged
georgi merged 1 commit into
mainfrom
chore/remove-dead-code
Aug 1, 2026
Merged

chore: remove dead code#4625
georgi merged 1 commit into
mainfrom
chore/remove-dead-code

Conversation

@claude

@claude claude Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Removes dead code across web/, electron/, and mobile/. Each removal was verified with a repo-wide identifier search before deleting; npm run typecheck, npm run lint, and npm run test all pass.

web/eslint.config.mjs:67 turns @typescript-eslint/no-unused-vars off, so unused imports in web/ accumulate without any signal. That is where most of this came from.

Removed

Unused imports

File Removed Why
web/src/components/sketch/__tests__/transformCorrectness.test.ts LayerTransform, SketchDocument, IDENTITY_AFFINE, isAffineTransform, makeSingleQuadTransform, fxComposeMatrix as composeAffineMatrix, getRasterBounds, scaledHalfExtents, rotatePoint, dist, HANDLE_RADIUS, ROTATION_HANDLE_OFFSET, TransformHandle, computeRotateTransform Each appears only on its own import line
web/src/components/sketch/__tests__/moveTransformUnification.test.ts LayerTransform, makeAffineTransform, quadOf, createPreviewSession, getRasterBounds, getToolHandler Same; getToolHandler was the only binding from ../tools, so that import goes too
web/src/components/sketch/__tests__/helperToolSession.test.ts HelperSetupInfo, HelperDrawInfo, createDefaultLayer The type-only import from HelperToolSession had no remaining names
web/src/components/sketch/__tests__/transformPreviewBoundaries.test.tsx React, createDefaultLayer, SketchDocument jsx: "react-jsx" — no React import needed
web/src/components/sketch/__tests__/sketchFeaturesCoverage.test.ts LayerContentBounds, getCanvasRasterBounds Unreferenced
web/src/components/hugging_face/model_list/__tests__/useModels.scope.test.tsx getHfCacheKey, UnifiedModel Unreferenced
web/src/components/node_types/editing/promptComposer/__tests__/promptTokens.test.ts tokenizePrompt Imported but never exercised; the suite only covers tokenizePromptLine
web/src/contexts/__tests__/EditorInsertionContext.test.tsx * as React jsx: "react-jsx"
web/src/lib/dragdrop/__tests__/useDropZone.test.tsx DragData Unreferenced
electron/src/runtime/packages/__tests__/registry.test.ts RuntimeContext, RuntimeResolution, RuntimeStatus Unreferenced
electron/src/__tests__/ipc.test.ts updateTrayMenu Only consumer was the dead updateTrayMenuMock below
electron/src/__tests__/events.test.ts getMainWindow Only consumer was the dead getMainWindowMock below

Unused locals

File Removed Why
electron/src/__tests__/events.test.ts getMainWindowMock Assigned, never read — the suite asserts on mockWindow.webContents.send directly
electron/src/__tests__/ipc.test.ts updateTrayMenuMock Assigned, never read
electron/src/__tests__/settings.test.ts originalHomedir Assigned, never read; the suite restores via (os.homedir as jest.Mock).mockRestore()
web/src/__tests__/performance/nodeComponentsPerformance.test.tsx _assertPerf and its SHOULD_ENFORCE_PERF flag A perf-gate helper no test ever calls; the PERF_TESTS env var it read is referenced nowhere else in the repo

Abandoned commentary

web/src/stores/timeline/__tests__/TimelineStore.test.ts — a 7-line block of contradicting scratch notes ("No wait...", "Actually we need...") above the trimClipStart no-op test, replaced by one line stating the arithmetic the test actually checks.

Not removed

Things the scan flagged that turned out to be live:

  • web/src/perf/realtimePerfHarness.ts — reached from web/perf-realtime.html, not from an import.
  • web/src/components/ChatMarkdownTest.tsx — lazy-routed in web/src/index.tsx; its "unused const result" is inside a markdown fixture string.
  • Story exports in web/src/stories/* and __mocks__/* — consumed by Storybook and Jest by convention, not by name.
  • ~40 web and ~20 mobile files carry an unused import React from "react". Both would be safe to strip (jsx: "react-jsx"), but that sweep alone blows the 15-file budget, so it is left for a follow-up.

Verification

npm run typecheck   # pass
npm run lint        # pass (pre-existing warnings only)
npm run test        # pass

🤖 Generated with Claude Code

Removes unused imports, unused locals, and one block of abandoned scratch
commentary across web, electron, and mobile. Every removal was verified with a
repo-wide identifier search first.

Web disables `@typescript-eslint/no-unused-vars` (web/eslint.config.mjs:67), so
unused imports there accumulate silently — that is where most of these came
from.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@georgi
georgi merged commit ce8d5eb into main Aug 1, 2026
23 checks passed
@georgi
georgi deleted the chore/remove-dead-code branch August 1, 2026 09:20
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