Skip to content

700ms streaming tick re-renders all three main panes #91

Closed

Description

@currentbits

Only Markdown (Markdown.tsx:74) and MessageBlock (ThreadView.tsx:385) are memoized. Every thread:updated tick (tickMs: 700, electron/main.js:278) maps a new threads array in useCoder.ts:448-452, so App re-renders Sidebar + ThreadView + AgentsPanel (~7,400 lines of components) per tick, on top of auto-animate in the sidebar. Fine on one thread; with five concurrent streams it's a constant render storm.

Fix: memoize the panes and split the streaming detail subscription from the list subscription, so a streaming thread doesn't re-render the whole shell.

Found during the 2026-08-16 improvement audit.

Activity

  1. added
    enhancementNew feature or request
    and removed on Aug 16, 2026
  2. currentbits commented on Aug 16, 2026

    @currentbits
    OwnerAuthor

    Fixed in 96b984c on coder/700ms-streaming-tick-re-renders-all-thre-f41da5.

    • patchThreadList (src/threadPatch.ts) keeps the array and row identity when the pushed summary did not move, so a tick that only grew the transcript never touches the list.
    • mergeThreadPatch keeps the previous thread/usage objects when structurally equal, so a rebuilt-but-identical object no longer invalidates panes or effects keyed on them.
    • Sidebar, ThreadView and AgentsPanel are memo'd; App holds every handler stable for that to bite. ThreadView takes a resolved handoffSource and AgentsPanel a rosterKey instead of the whole list, whose identity churns by design.

    Net: a background stream costs nothing while it is quiet, and one sidebar row re-render when it appends; the open thread re-renders ThreadView only.

    Checks: npm run typecheck, npm run build, npm run test:renderer (700/700) all green. New unit coverage in test/threadPatch.test.ts for the identity guarantees.

  3. added a commit that references this issue on Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions