You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: split appReducer into agentReducer + conversationReducer (H2)
Break 230-line monolithic appReducer (22 cases) into two focused
sub-reducers: agentReducer (12 actions) and conversationReducer
(11 actions). AppStateContext.tsx now delegates via a thin switch.
Added 39 new unit tests covering 11 previously untested actions.
All 227 tests pass. Patch bump to v0.10.6.
Co-Authored-By: Claude <claude-sonnet-4>
Copy file name to clipboardExpand all lines: aidocs/code-review.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ The codebase is generally well-structured with clear separation between main pro
12
12
13
13
| Severity | Count | Resolved |
14
14
|----------|-------|----------|
15
-
| High | 7 |3|
15
+
| High | 7 |4|
16
16
| Medium | 15 | 2 |
17
17
| Low | 10 | 3 |
18
18
@@ -44,11 +44,13 @@ The codebase is generally well-structured with clear separation between main pro
44
44
45
45
---
46
46
47
-
### H2. 248-Line Reducer in AppStateContext.tsx
47
+
### H2. ~~248-Line Reducer in AppStateContext.tsx~~ ✅ RESOLVED
48
48
49
-
`src/renderer/contexts/AppStateContext.tsx` — the `appReducer`function has 22 case branches in ~248 lines. Agent-filtering logic is duplicated between `REMOVE_AGENT` and `SET_ACTIVE_AGENT`. Several cases have 3-4 levels of nesting.
49
+
**Resolved in v0.10.6** — Split monolithic `appReducer`(22 cases, 230 lines) into two focused sub-reducers: `agentReducer` (12 actions) and `conversationReducer` (11 actions). Composed `appReducer` now delegates via a thin switch. Added 39 new unit tests covering 11 previously untested actions. All 227 tests pass.
50
50
51
-
**Fix:** Split into focused sub-reducers (`agentReducer`, `conversationReducer`, `viewReducer`) composed together.
51
+
~~`src/renderer/contexts/AppStateContext.tsx` — the `appReducer` function has 22 case branches in ~248 lines. Agent-filtering logic is duplicated between `REMOVE_AGENT` and `SET_ACTIVE_AGENT`. Several cases have 3-4 levels of nesting.~~
52
+
53
+
~~**Fix:** Split into focused sub-reducers (`agentReducer`, `conversationReducer`, `viewReducer`) composed together.~~
52
54
53
55
---
54
56
@@ -324,7 +326,7 @@ Several test files have unused imports:
0 commit comments