Skip to content

refactor: remove frontend dead code (orphaned files, unreachable exports)#24

Open
vibhavkatre wants to merge 1 commit into
mainfrom
refactor/dead-code-frontend
Open

refactor: remove frontend dead code (orphaned files, unreachable exports)#24
vibhavkatre wants to merge 1 commit into
mainfrom
refactor/dead-code-frontend

Conversation

@vibhavkatre

Copy link
Copy Markdown
Collaborator

First of three cleanup passes (backlog #9: refactor, optimise, remove unused/dead code). This one is pure deletion — no behaviour changes.

Every removal was verified unreferenced from both source and tests, accounting for unplugin-vue-components auto-import (components can be used without an explicit import, so tag-name usage was checked too).

Orphaned files — 282 lines

File Why it's dead
useHoverArrows.js Select-mode hover arrows were removed. HoverArrows.vue does its own connector-anchor logic and never imported this composable.
NewDiagramDialog.vue The diagram-type picker, dropped when "New diagram" started creating a unified doc directly.
TextSection.vue Superseded by the text controls in BlockSelectionEditor.

Unreachable exports

  • deleteNode (mindmapOperations) — the plural deleteNodes is what callers use
  • reassignBranchColors (mindmapOperations) — never wired to a control
  • isLocked (shapeFlags) — isInteractable covers every caller's need
  • THEME_PRESET_NAMES (theme) — presets are read via findThemePreset
  • STROKE_KINDS (whiteboardModel) — stroke kind is set at the call site
  • toggleOutline + outlineVisible, notesNodeId (mindmapUi) — vestigial state for an outline/notes side panel that was never built; nothing read either field

Dependency

Dropped @tiptap/extension-underline — Tiptap 3 ships Underline inside starter-kit, so the direct dep was redundant. yarn.lock is unchanged, which confirms it was already resolving transitively.

Also commits the stale components.d.ts regeneration (DriveMenu was added in #23 but the generated file was never committed).

Four unwired features found — deliberately KEPT

Code that exists but nothing can reach. Deleting these would cement the gap, so each now carries a comment saying it's unwired:

  1. unlinkNodes — cross-links can be created from the mind-map overlay but there is no way to delete one
  2. toggleFocus — focus mode renders correctly (MindMapNodeLayer reads focusId) but has no activator
  3. startPaletteDrag — the canvas drop handler is live, but no palette tile produces the drag payload, so drag-a-tool-onto-canvas is unreachable
  4. duplicate_diagram (backend) — no UI calls it

These are worth triaging as part of the Phase-1 unified-canvas fix pass.

Testing

  • 102 vitest tests pass
  • yarn build clean

🤖 Generated with Claude Code

…rts)

Audit pass over frontend/src for code nothing can reach. Behaviour-preserving:
every removal is verified unreferenced from both source and tests.

Orphaned files (282 lines):
- useHoverArrows.js — select-mode hover arrows were removed; HoverArrows.vue
  does its own connector-anchor logic and never imported this composable.
- NewDiagramDialog.vue — the diagram-type picker, dropped when "New diagram"
  started creating a unified doc directly.
- TextSection.vue — superseded by the text controls in BlockSelectionEditor.

Unreachable exports:
- deleteNode (mindmapOperations) — the plural deleteNodes is what callers use.
- reassignBranchColors (mindmapOperations) — never wired to a control.
- isLocked (shapeFlags) — isInteractable covers every caller's need.
- THEME_PRESET_NAMES (theme) — presets are read via findThemePreset.
- STROKE_KINDS (whiteboardModel) — stroke kind is set at the call site.
- toggleOutline + outlineVisible, notesNodeId (mindmapUi) — vestigial state for
  an outline/notes side panel that was never built; nothing read either field.

Dependency:
- Drop @tiptap/extension-underline. Tiptap 3 ships Underline inside starter-kit,
  so the direct dep was redundant — yarn.lock is unchanged, which confirms it.

Also commits the stale components.d.ts regeneration (DriveMenu was added in #23
but the generated file was never committed).

Four unwired features were found and deliberately KEPT, each now carrying a
comment saying so, because deleting them would cement the gap: unlinkNodes
(cross-links can be created but never deleted), toggleFocus (focus mode renders
but has no activator), startPaletteDrag (canvas drop handler is live but no
palette tile produces the payload), and the duplicate_diagram endpoint.

Tests: 102 vitest pass, frontend build clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge with no actionable regressions identified.

All removed files, exports, and UI-state fields have no remaining consumers, while underline support remains provided and configured through Tiptap StarterKit.

Reviews (1): Last reviewed commit: "refactor: remove frontend dead code (orp..." | Re-trigger Greptile

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.

2 participants