Context
The repository has grown from prototype shape into application shape. Several files now concentrate too many responsibilities and make future Codex-assisted changes harder to scope and verify.
Current hotspots include:
web/src/App.tsx: React app shell, state orchestration, canvas rendering, dialogs, output drawer, analysis controls, plots, tutorial, and many pure helpers.
web/src/styles.css: all web styling in one stylesheet.
web/tests/cqedraw-web.spec.ts: all Playwright coverage in one large spec.
cqedraw/app.py: Tkinter desktop UI, data classes, persistence, selection, clipboard, rendering, and core-output adapter logic.
Goal
Refactor incrementally without changing behavior, file formats, CLI behavior, generated C / L_inv output, or web UI selectors.
Acceptance Criteria
- Add an advisory source-size report so future work can see file-size hotspots.
- Document soft size caps for maintainability.
- Split web hotspots first through small behavior-preserving PRs.
- Preserve
web/src/App.tsx as the app entry component while extracting helpers/components/hooks.
- Split CSS and Playwright tests after initial React extractions.
- Split the Python desktop app after web hotspots, while preserving public imports from
cqedraw.app.
- Run targeted tests after each slice and full relevant checks before PR handoff.
Soft Caps
Aim for most source files below roughly 800-1000 lines and React components/hooks below roughly 300-500 lines. Treat the caps as advisory, not failing CI, until the codebase is closer to the target shape.
Context
The repository has grown from prototype shape into application shape. Several files now concentrate too many responsibilities and make future Codex-assisted changes harder to scope and verify.
Current hotspots include:
web/src/App.tsx: React app shell, state orchestration, canvas rendering, dialogs, output drawer, analysis controls, plots, tutorial, and many pure helpers.web/src/styles.css: all web styling in one stylesheet.web/tests/cqedraw-web.spec.ts: all Playwright coverage in one large spec.cqedraw/app.py: Tkinter desktop UI, data classes, persistence, selection, clipboard, rendering, and core-output adapter logic.Goal
Refactor incrementally without changing behavior, file formats, CLI behavior, generated
C/L_invoutput, or web UI selectors.Acceptance Criteria
web/src/App.tsxas the app entry component while extracting helpers/components/hooks.cqedraw.app.Soft Caps
Aim for most source files below roughly 800-1000 lines and React components/hooks below roughly 300-500 lines. Treat the caps as advisory, not failing CI, until the codebase is closer to the target shape.