mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
1.9 KiB
1.9 KiB
id, title, status, assignee, created_date, updated_date, labels, dependencies, priority
| id | title | status | assignee | created_date | updated_date | labels | dependencies | priority | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TASK-79 | Introduce explicit runtime state transitions and reducers in main | To Do | 2026-02-18 11:43 | 2026-02-18 11:43 |
|
|
medium |
Description
Main runtime state is currently mutable from many callsites. This task introduces explicit state-transition functions (reducer-like actions) for critical state domains to improve traceability and reduce accidental cross-feature coupling.
Suggestions
- Start with high-risk domains: overlay visibility, MPV connection/session, AniList/Jellyfin runtime status.
- Use action-style transition helpers (
setMediaPath,setOverlayVisibility,setAnilistState) instead of direct field mutation. - Keep transition helpers side-effect free; invoke effects in orchestration layer.
Action Steps
- Inventory direct mutation hotspots in
src/main.tsand runtime modules. - Define state transition API in
src/main/state.tsfor priority domains. - Migrate callsites incrementally to transition helpers.
- Add unit tests for transition behavior and invariant enforcement.
- Add lightweight debug tracing for transition events in debug mode.
- Document state ownership and mutation rules in architecture docs.
Acceptance Criteria
- #1 Critical runtime state domains mutate through explicit transition helpers
- #2 State invariants are test-covered
- #3 Direct ad-hoc mutation in migrated domains is removed
- #4 Ownership/mutation rules documented
Definition of Done
- #1 Core tests pass after migration
- #2 No behavior regressions in startup/IPC/overlay flows