refactor(web/ui): migrate chat messages to fine-grained createStore #121
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_shrimp!121
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "integration_streaming_store_finegrained"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Migrates the chat thread's
messagesfrom a coarsecreateSignal<Msg[]>(whole-array, by-reference replacement) to a fine-grained SolidJScreateStore<Msg[]>. Per-token, per-tool, and finalize updates now mutate message fields in place viaproduce, so SolidJS<For>no longer remounts per-message subtrees (LiveJobPanel, MessageInsights, ThinkingPane) on every update. This removes the remount-by-reference root cause behind the "card keeps refreshing" flicker, on top of the band-aids already present.This is the smallest high-value change that fixes the root cause. It intentionally does NOT build the broader "per-session typed event channel / SPMC wire" described in the issue, nor consolidate
currentStreamingId+jobStreamJobId. The issue should not be auto-closed on this alone.Related Issue
Refs #37
Changes
store.ts:messagesis nowcreateStore<Msg[]>; all 13setMessagesmutation sites rewritten to in-placeproducemutations; conversation load usesreconcile(mapped, { key: "id" })to preserve row identity; appends useproduce(list => list.push(...)); 3 internalmessages()reads converted to proxy access.ChatThread.tsx:messages()->messages;<For each={messages}>; autoscroll memo tracksmessages.length.ConversationWork.tsx,TopBar.tsx,LibraryPage.tsx:messages()->messages.static/bundle.Hot-path conversions preserve existing semantics exactly:
flushStreamBufferkeeps thex.jobIdskip + inline-think re-derivation + idempotent set-from-full-buffer;turn:endkeeps the streaming/jobId skip and thefinalized->drainQueueflag; tool activity updates mutate.activitiesin place.Test Results
vite build): PASS — 101 modules transformed, bundle emitted.messages()call-style reads and zero signal-updater forms remain.7869d84bbcto095f4592f7