Skip to content

Commit e5c866a

Browse files
committed
Update backlog: mark renderer extraction and constants tests done
1 parent 735ccc5 commit e5c866a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/BACKLOG.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ The HUD now measures its live top/bottom offsets instead of relying on fixed `re
1515

1616
## P2 — Code Quality
1717

18-
### Continue shrinking large client coordinators
19-
`main.ts`, `renderer.ts`, and `ui.ts` are cleaner than they were, but they still carry too much orchestration and DOM/render state. Keep extracting pure helpers and view-model builders until those files are mostly wiring.
18+
### Shrink main.ts further (1,286 lines)
19+
`main.ts` is the only coordinator still over 1,000 lines. Its methods are mostly 5-20 line glue between extracted helpers — no single block is large enough for easy extraction. Consider whether a second-level split (e.g., separating local-game orchestration from network orchestration) is worthwhile.
2020

21-
**Files:** `src/client/main.ts`, `src/client/renderer.ts`, `src/client/ui.ts`
21+
**Files:** `src/client/main.ts`
2222

2323
## P3 — Test Coverage
2424

25-
### Add constants validation tests
26-
Add basic sanity tests for `SHIP_STATS` (e.g., no negative values, warships have `canOverload: true`, `defensiveOnly` ships have low combat ratings).
27-
2825
### Improve branch coverage on decomposed engine modules
29-
`engine-util.ts` (60% branches) and `engine-combat.ts` (70.5% branches) have coverage gaps. Add tests for edge cases in utility predicates and combat phase validation.
26+
`engine-combat.ts` (70.5% branches) has coverage gaps. Add tests for edge cases in combat phase validation.
3027

3128
## Done
3229

3330
- ~~Decompose game-engine.ts~~ — Extracted into `engine-util.ts`, `engine-victory.ts`, `engine-ordnance.ts`, `engine-combat.ts` with backward-compatible re-exports (681 lines, down from 1957)
3431
- ~~Add map-data.test.ts~~ — 23 tests covering map builder, body gravity, base placement, scenarios
3532
- ~~Add processEmplacement tests~~ — 10 tests covering emplacement validation and success paths
33+
- ~~Add constants validation tests~~ — 15 tests covering ship stats sanity, ordnance mass, combat/cost scaling
34+
- ~~Shrink renderer.ts~~ — Extracted `renderer-draw.ts`, `renderer-effects.ts`, `renderer-scene.ts`, `renderer-overlay.ts` (1,771 → 1,011 lines)
35+
- ~~Shrink ui.ts and input.ts~~ — Already under 1,000 lines (661 and 313 respectively)

0 commit comments

Comments
 (0)