Perf: Frontend whole-store subscriptions + no list virtualization #87
Labels
No labels
area:api
area:core
area:docs
area:infra
area:ux
dependencies
documentation
duplicate
good first issue
help wanted
invalid
question
rust
status:complete
status:partial
status:planned
type:bug
type:design
type:feature
type:infra
type:refactor
type:refactor
type:research
type:ux
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
icub3d/decentcom#87
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Category: Performance (frontend) — found in code review 2026-07-07.
Problem
client/src/components/layout/AppShell.tsx:16(andApp.tsx:28) subscribe to entire Zustand stores with no selector, so the whole subtree re-renders on every store mutation — everyMESSAGE_CREATE, reaction, typing/loading toggle. The whole chat UI reconciles on each incoming WS event.MessageList.tsx:69/MemberList.tsx:45render every item with no windowing;MessageItemis not memoized, so a new message re-renders every existing item.MemberList.tsx:32re-sorts on every render (unmemoized);MessageItem.tsx:39effect depends onmessage.threadobject identity so it re-fetches on any unrelated message update.Fix
useServerStore(s => s.channels)) oruseShallowfor grouped slices.React.memo(MessageItem); add windowing (@tanstack/react-virtual) for message + member lists.message.thread?.thread_id/reply_countprimitives in the effect.Landed on main via #107 (commit
e305ed3): useShallow selectors, React.memo(MessageItem) with primitive effect deps, @tanstack/react-virtual windowing for message/member lists, memoized member sort, sorted-insert on MESSAGE_CREATE.