# Architecture — Q-Edit ## Overview - **UI shell**: `index.html` + `style.css` - **App logic**: `script.js` (currently a single-file controller) - **New utilities**: `src/utils/format.js` (pure helpers; safe to unit test) - **Docs & CI**: under `docs/` and `.gitea/` ## Data Flow (current) 1. DOM is initialized from `index.html`. 2. `script.js` wires event listeners, loads data (local or remote), renders lists in `#content-summary` and sidebars (`#file-tree`), and manages pagination/filtering. 3. User interactions update in-memory state and the DOM. ## Near-Term Refactor Plan - Gradually split `script.js` into modules: - `src/state/*` for app state - `src/services/*` for data I/O - `src/ui/*` for rendering - `src/utils/*` for helpers (started) - Load modules via `