Skip to content

refactor: remove dead code and Java-port scaffolding#31

Merged
DanteCpp merged 2 commits into
mainfrom
lcf
Jun 24, 2026
Merged

refactor: remove dead code and Java-port scaffolding#31
DanteCpp merged 2 commits into
mainfrom
lcf

Conversation

@DanteCpp

Copy link
Copy Markdown
Owner

Summary

Simplifies the codebase by deleting unused infrastructure that was ported from FidoCadJ (or stubbed for future work) but never wired to a consumer. No behavioral change — the full Vitest suite (721 tests), production build, and the byte-stable export fixtures all remain green.

Net: ~2,400 lines removed across 185 files; 10 files deleted, 1 added.

What changed, by tier

1 — Boilerplate & dead files

  • Stripped @file/@author/@date/@brief/@copyright headers from src/ and test/ (per AGENTS.md's "Do not add boilerplate file headers").
  • Deleted dead files: FontG.ts, UndoState.ts (+ its test), LibraryListenerAdapter.ts.

2 — Unused observer system in LibraryModel

  • Removed the event classes (AddEvent, RemoveEvent, RenameEvent, KeyChangeEvent, LibraryListener), listener registration, and all fire* plumbing. No production code ever registered a listener — the macro-picker UI rebuilds via a direct forceUpdate() (pull), not the push-based events.

3 — Dead accessors & orphaned state

  • Deleted 54 never-called getX/setX/isX methods across 18 files (mostly Java-port stubs: "Phase 4" placeholders, always-true validators, unwired image-overlay controls), plus the fields they orphaned and the unused createRenderCtx factory.

4 — Abandoned exporter base class

  • Deleted AbstractExport (~226 lines) — written but never extended; the four exporters all implements ExportInterface directly. Kept the live escapeLatex helper, moved to LatexEscape.ts.

What was intentionally left alone

  • A blanket live getX()/setX() → public-field conversion: accessor names are shared across many classes and TS has no method→field inline refactor, so a mechanical text rewrite isn't safe. Limited to dead-accessor removal.
  • Reunifying the four exporters under a real base class: large, risky change against byte-stable fixture output for little gain.

Verification

  • npm run verify (tsc strict + 721 tests) ✅
  • npm run build
  • npm run lint — 0 errors (3 pre-existing warnings, untouched files) ✅

DanteCpp added 2 commits June 24, 2026 19:48
Simplify the codebase by deleting unused infrastructure that was ported
from FidoCadJ (or stubbed for future work) but never wired to a consumer.
No behavioral change; full test suite, production build, and export
fixtures remain green.

- Strip boilerplate @file/@author/@copyright headers from src and test
  (per AGENTS.md "no boilerplate file headers").
- Remove dead files: FontG, UndoState, LibraryListenerAdapter.
- Remove the unused LibraryModel observer system (event classes,
  listener registration, and fire* plumbing); no production code ever
  registered a listener.
- Delete 54 never-called accessor methods and the fields they orphaned,
  plus the unused createRenderCtx factory.
- Delete the abandoned AbstractExport base class (no exporter extended
  it); keep the live escapeLatex helper, renamed to LatexEscape.

Net: ~2,400 lines removed across 185 files.
@DanteCpp
DanteCpp merged commit 159d8a5 into main Jun 24, 2026
9 checks passed
@DanteCpp
DanteCpp deleted the lcf branch June 24, 2026 19:03
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