Skip to content

chore: remove dead code - #5111

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

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

Conversation

@claude

@claude claude Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Removes code in web/src with zero production callers. Each item was verified with a repo-wide word-boundary grep across web, electron, mobile, packages, and scripts before deletion; the check is recorded per item below.

Removed

Item File Why it is dead
editorHotkeys.ts (whole module: model3DEditorHotkey + Model3DEditorHotkey) web/src/components/model_editor/ Maps key events to 3D-editor commands, but nothing in model_editor/ registers a keydown handler — the only key handling there is SceneOutliner's inline Enter/Space on its own rows. The module was imported only by its own test.
exportWorkflowsBundle web/src/utils/workflowBundle.ts Multi-workflow .nodetool export helper. The command menu calls the single-workflow exportWorkflowBundle; the plural variant had no caller. The POST /api/workflows/export-bundle route stays — the CLI (nodetool workflows export-bundle) still uses it.
isHuggingFaceLocalProvider web/src/utils/providerDisplay.ts Unused. isLocalProvider in the same file already matches huggingface-local inline.
isHuggingFaceInferenceProvider web/src/utils/providerDisplay.ts Unused; no caller ever distinguished HF inference providers.
isRenderableData web/src/components/appbuilder/appData.ts One-line pass-through to isRenderableUi from @nodetool-ai/app-runtime, called by nothing. Its now-unused isRenderableUi import goes with it.
isOptionalNamespace web/src/config/optionalNodePacks.ts One-line wrapper over getOptionalNodePackForNamespace. Callers use that function or isNamespaceHiddenByOptionalPacks directly.

Each removal takes its own test block with it (a test is the only thing that referenced any of these). No other test lost coverage: the surrounding suites for providerDisplay, optionalNodePacks, appData, and workflowBundle still cover every remaining export.

Deliberately kept

Several symbols look dead to a naive "only referenced by tests" scan but are not:

  • expandSelectionMask / contractSelectionMask / translateMask in components/sketch/selection/selectionMask.ts — these are the CPU reference implementations that selectionFeatures.test.ts installs as the *SelectionGpu test double, so the slice's pad-then-trim ROI logic can be exercised without a WebGPU device. Removing them would gut that test.
  • __reset*ForTests / clear* helpers across stores and hooks — intentional test seams.
  • SNIPPET_CATEGORIES in config/codeSnippets.ts — a runtime mirror of the SnippetCategory union that its test uses to pin exhaustiveness.
  • getSupabaseConfigError in lib/supabaseClient.ts — a diagnostic accessor whose test asserts the actual config-error text; removing it would drop that assertion.

Not found

Some categories in the brief turned up nothing in scope, which is worth recording so the next pass can skip them:

  • Unreachable code: tsc --allowUnreachableCode false reports zero TS7027 across web, electron, and mobile.
  • Commented-out code blocks: a heuristic scan for runs of 5+ code-shaped // lines found none. Lowering the threshold to 3 surfaced only two blocks, both genuine prose comments — so the scan does fire, it just had nothing to report.
  • Orphaned modules: no non-test module in the three trees is unimported, apart from editorHotkeys.ts above.
  • Unused imports / locals: oxlint with no-unused-vars enabled is clean in electron and mobile. Web's remaining hits are the rest-omit destructuring idiom (const { children, ...rest }) and leading positional callback parameters (ReactFlow/MUI handler signatures) that can only be renamed, not removed.
  • electron / mobile: no dead code found. Both are untouched by this PR.

Outside this PR's scope, packages/agents/src/capabilities/*.ts carries ~100 genuinely unused imports and destructured *_SCHEMA constants that npm run lint already reports as warnings. Worth its own change.

Verification

npm run typecheck   # web + electron + mobile — pass
npm run lint        # exit 0 (remaining warnings all pre-existing, in packages/agents)
npm run test        # web 13299 passed / electron 682 passed / mobile 1039 passed, 0 failures

npm run build:packages is required before typecheck on a fresh checkout, otherwise web reports TS2307 on unbuilt @nodetool-ai/*-nodes subpaths.

🤖 Generated with Claude Code

Six unused symbols in web/src, verified to have zero production callers.

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