mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-09 16:19:25 -07:00
- task-238.1: Extract main/overlay window composition from src/main.ts - task-238.2: Extract CLI and headless command wiring from src/main.ts
2.7 KiB
2.7 KiB
id, title, status, assignee, created_date, labels, milestone, dependencies, references, parent_task_id, priority
| id | title | status | assignee | created_date | labels | milestone | dependencies | references | parent_task_id | priority | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TASK-238.1 | Extract main-window and overlay-window composition from src/main.ts | Done | 2026-03-26 20:49 |
|
m-0 |
|
TASK-238 | high |
Description
src/main.ts still directly owns several BrowserWindow construction and window-lifecycle paths, including overlay-adjacent windows and setup flows. That keeps the composition root far larger than intended and makes window behavior hard to test in isolation. Extract the remaining window/bootstrap composition into named runtime modules so src/main.ts mostly wires dependencies and app lifecycle events together.
Acceptance Criteria
- #1 At least the main overlay window path plus two other window/setup flows are extracted from direct
BrowserWindowconstruction insidesrc/main.ts. - #2 The extracted modules expose narrow factory/handler APIs that can be tested without booting the whole app.
- #3
src/main.tsbecomes materially smaller and easier to scan, with window creation concentrated behind well-named runtime surfaces. - #4 Relevant runtime/window tests pass, and new tests are added for any newly isolated window composition helpers.
Implementation Plan
- Map the remaining direct
BrowserWindowcreation sites insrc/main.tsand group them by shared lifecycle concerns. - Extract coherent modules for construction, preload/path resolution, and open/focus/reuse behavior rather than moving raw option objects wholesale.
- Update the composition root to consume the new modules and keep side effects/app state ownership explicit.
- Verify with focused runtime/window tests plus
bun run typecheck.
Completion Notes
- Window composition now flows through
src/main/runtime/setup-window-factory.tsandsrc/main/runtime/overlay-window-factory.ts, withsrc/main/runtime/overlay-window-runtime-handlers.tscomposing the main/modal overlay entrypoints. src/main.tskeeps dependency wiring and state ownership, while the named runtime helpers own the reusable window-creation surfaces.- Verification:
bun test src/main/runtime/overlay-window-factory.test.ts src/main/runtime/overlay-window-runtime-handlers.test.tsbun run typecheckfailed on unrelated existing errors insrc/core/services/immersion-tracker/lifetime.ts,src/core/services/immersion-tracker/maintenance.ts, andsrc/core/services/stats-server.ts