# v0.10.3 — Frontend Refactor Plan ## Problem Two monolith files accumulate every feature: | File | Lines | Role | |----------|------:|-----------------------------------| | app.js | 2,940 | All application logic + listeners | | ui.js | 2,582 | All rendering + admin + settings | | api.js | 575 | HTTP client (fine) | | debug.js | 580 | Debug logger (fine) | | events.js| 327 | EventBus WebSocket (fine) | | **Total**| **7,004** | | The v0.10.2 syntax bug (orphan brace nesting everything from notes through banners) is a direct consequence: in a 2,940-line file, a misplaced insertion is invisible. ## Constraints - **Vanilla JS** — no build step, no bundler, no ES modules. - **Global functions** — HTML `onclick` handlers call ~25 named globals. These must stay on `window`. No renaming. - **Load order via `