diff --git a/docs/plans/2026-02-17-frontend-modularization-design.md b/docs/plans/2026-02-17-frontend-modularization-design.md new file mode 100644 index 0000000..7489b79 --- /dev/null +++ b/docs/plans/2026-02-17-frontend-modularization-design.md @@ -0,0 +1,132 @@ +# Frontend Modularization Design + +## Problem + +The frontend is a single 1,436-line `app.js` file handling state, canvas rendering, zoom/pan, SSE streaming, solver control, associate matching, and UI interactions. As the project grows and attracts contributors, this monolith becomes hard to navigate, refactor, and reason about — both for humans and code agents. + +## Approach + +Split `app.js` into ES modules with JSDoc type annotations. No build step — browsers natively support ` + + + +``` + +## Backend Changes + +None. FastAPI's `StaticFiles` mount serves all `.js` files. ES module imports resolve via HTTP requests automatically. + +## Verification + +- All existing functionality works identically after the split +- No new dependencies, no `package.json`, no `node_modules` +- VS Code shows type errors via `@ts-check` without any build command