docs: update reorganize-long-files spec to include CSS reorganization

Add Phase 2 (CSS Reorganization) covering:
- Restore styles/ directory (tokens, global, utilities, syntax-highlight)
- Restore styles/pages/*.css for page-specific styles
- Restore 11 component CSS modules from monolithic styles.css
- Delete styles.css after extraction

Shift frontend page extraction phases to 3-7.
Add visual regression checks to integration phase.

Quality gates unchanged: tsc, build, py_compile, file size limits
This commit is contained in:
Developer
2026-06-05 10:33:10 +00:00
parent d472c41092
commit 7070867393
2 changed files with 134 additions and 53 deletions
+43 -9
View File
@@ -47,7 +47,40 @@ Split the following pages into a thin page shell + extracted components:
- Extract `ProjectEditDialog` → edit form in dialog
- Page becomes: data loader + layout + dialog state manager
#### 2. Backend Router Slimming
#### 2. CSS Reorganization
**`styles.css` (5,683 lines → deleted)**
- Restore `styles/` directory with extracted files:
- `styles/tokens.css` — CSS custom properties (colors, spacing, typography)
- `styles/global.css` — global reset, body, shell layout
- `styles/utilities.css` — utility classes (.stack, .card, .muted, etc.)
- `styles/syntax-highlight.css` — code highlighting
- Restore `styles/pages/*.css` — page-specific styles:
- `styles/pages/dashboard.css`
- `styles/pages/projects.css`
- `styles/pages/sessions.css`
- `styles/pages/settings.css`
- `styles/pages/ssh-keys.css`
- `styles/pages/git-history.css`
- `styles/pages/repo-workspace.css`
- Restore component CSS modules:
- `components/features/terminal/TerminalComponent.module.css`
- `components/features/git/GitToolbar.module.css`
- `components/features/git/CommitDialog.module.css`
- `components/features/git/MergeDialog.module.css`
- `components/features/git/FileEditor.module.css`
- `components/features/git/FileBrowser.module.css`
- `components/features/git/FileViewer.module.css`
- `components/features/git/CommitPanel.module.css`
- `components/features/session/InstanceList.module.css`
- `components/features/settings/SettingsTabLayout.module.css`
- `components/layout/AppShell.module.css`
- Update all component imports to use `import styles from './ComponentName.module.css'`
- Update `main.tsx` to import `styles/tokens.css`, `styles/global.css`, `styles/utilities.css`, `styles/syntax-highlight.css`
- Update each page to import its `styles/pages/*.css`
- Delete monolithic `styles.css`
#### 3. Backend Router Slimming
**`api/tool/tool_instances.py` (2,900 → ~300 lines)**
- Extract terminal WebSocket handlers → `api/tool/terminal.py` (~400 lines)
@@ -72,19 +105,20 @@ Split the following pages into a thin page shell + extracted components:
- Frontend UI behavior changes (same components, same interactions)
- Moving existing `features/` components (already organized)
- Renaming files (naming already done)
- CSS changes (styles already work)
- Changing any CSS rules (only moving them)
## Acceptance Criteria
1. All pages ≤ 150 lines (except `RepoWorkspacePage` which may stay at ~150)
2. All API routers ≤ 400 lines
3. All existing tests pass without modification (behavior unchanged)
4. All existing API endpoints return identical responses
5. Frontend `npm run typecheck` passes
6. Frontend `npm run build` passes
7. Backend `py_compile` passes on all files
8. No import errors in browser console
9. File count increases (more files, smaller files)
3. No monolithic `styles.css` — all CSS in `styles/` directory or `.module.css` files
4. All existing tests pass without modification (behavior unchanged)
5. All existing API endpoints return identical responses
6. Frontend `npm run typecheck` passes
7. Frontend `npm run build` passes
8. Backend `py_compile` passes on all files
9. No import errors in browser console
10. File count increases (more files, smaller files)
## Preconditions