Repository navigation
Closed
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-reactReact chat/files/voice components, stores, WebSocket transport.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: refactorStructure changes; behaviour does not. No changeset-visible effect.
Milestone
Description
Part of #1342.
Context
createChatStore is one ~1,070-line closure (packages/ui-react/src/stores/chat-state.ts:1100-2172), and the ChatState interface declares 54 actions. Every buffer mutation goes through mutateBuffer (same file:1170), which re-maps the whole message list on each call when journals is present.
Chat-send assembly is #2521; it touches the store's addUserMessage/withdrawSend callers, not its internals, so the two do not conflict.
Scope
- Slices for messages/streaming, ask-user, approvals and attachments, composed into the same per-root store returned today.
Out of scope
- Changing hook names, selectors or
BrainUiServicestypes. - Applying journal receipts when the journal frame arrives instead of on every
mutateBuffercall. It changes when a render happens, so it is a separate behavioural change after this split.
Acceptance criteria
- No function in
chat-state.tsexceeds ~200 lines; each slice has direct tests. - Existing ui-react unit and browser suites pass unchanged.
Verification
bun run test packages/ui-react
bun run typecheckContract impact
None.
2026-10-24: removed the closed #1380 blocker and the completed #910/#1328 coordination note, refreshed the range, and folded the 2026-10-22 source check (journal-receipt timing stays out of this pure split; #2521 is independent).
Metadata
Metadata
Assignees
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-reactReact chat/files/voice components, stores, WebSocket transport.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: refactorStructure changes; behaviour does not. No changeset-visible effect.
Activity
schlessera commentedon Oct 9, 2026
Unblocked: #1380 is closed, so
scripts/sync-project.tsis removing theblockedlabel.schlessera commentedon Oct 21, 2026
Source check at
dcf5341aaduring the 2026-10-22 repository review:createChatStoreis now 1,073 lines,packages/ui-react/src/stores/chat-state.ts:1100-2172, in a 2,172-line file. The body says about 900 lines at:989-1892. TheChatStateinterface declares 54 actions (chat-state.ts:373-657).Blocked by #1380, but ui-react: stores and lib import from components #1380 is closed. The stale blocker line should be removed (the issue does not carry theblockedlabel).mutateBuffer(chat-state.ts:1170-1184). Whenjournalsis present, it re-maps the whole message list on each call, which means O(n) work and a newmessagesarray for every token delta. Applying journal receipts when the journal frame arrives, instead of on every mutation, falls naturally out of a transcript/stream slice. Note, though, that it changes when a render happens, so it belongs in a separate behavioural change, not inside this pure split.sendChatMessageservice touches the store'saddUserMessage/withdrawSendcallers but not the store's internals, so the two do not conflict.schlessera commentedon Nov 2, 2026
Claiming (token
wi-1361-c7f2). Branchrefactor/1361-chat-store-slicesfromepic/1342-turn-path-split(at 0c3b837); the PR targets the epic integration branch and closes this issue when the epic batch lands on main. Collision report forchat-state.ts: closure-only overlaps with open drafts (#3054, #3056 and others); no open PR changes the file. #3305 on the same epic branch touches three docs that citechat-state.ts; citation repairs here sit in separate hunks.schlessera commentedon Nov 2, 2026
Implementation is in #3360 (head
238eff785), which targetsepic/1342-turn-path-split(base0c3b83762). It covers both acceptance criteria:createChatStoreis now a 20-line composer over seven slices. The largest function is 181 lines.Local preflight passed and hosted proof has been requested. This issue closes when the epic batch lands on
main.refactor(ui-react): split createChatStore into composed slices (#3360)
schlessera commentedon Nov 2, 2026
Delivered to the epic integration branch
epic/1342-turn-path-splitasa5cd3e8eavia #3360, after ready-candidate proof passed against the exact epic base. This issue closes when the epic batch lands on main.