Skip to content

perf(frontend): reduce long chat rerenders - #1996

Open
floze-the-genius wants to merge 1 commit into
codecentric:mainfrom
floze-the-genius:perf/chat-history-rendering
Open

perf(frontend): reduce long chat rerenders#1996
floze-the-genius wants to merge 1 commit into
codecentric:mainfrom
floze-the-genius:perf/chat-history-rendering

Conversation

@floze-the-genius

@floze-the-genius floze-the-genius commented Jul 18, 2026

Copy link
Copy Markdown

Summary

  • defer rendering work for offscreen historical messages while keeping the latest exchange fully rendered for streaming and autoscroll
  • memoize chat items and stabilize document-selection callbacks so unchanged messages do not rerender
  • subscribe AI-writing consumers to the derived boolean instead of the entire chat map
  • add regression tests for historical-message rerenders and message-only store updates

Closes #500

Validation

  • npm run lint
  • focused Vitest coverage: 4 files, 11 tests passed
  • existing ChatInput/Markdown baseline: 9 tests passed
  • npm run build
  • npm pack --dry-run
  • git diff --check
  • full frontend suite under Node 24: PR head has 23 failing / 130 passing tests across 9 failing / 23 passing files; a detached clean origin/main worktree with the same dependencies reproduces the same 23 failures across the same 9 unrelated admin/login suites, with 128 passing tests across 21 passing files. The two added regression files account for the PR head's additional 2 passing files and 2 passing tests.

The reproduced baseline failures are existing MSW/date-sensitive admin and login test failures, including unmatched mocked requests. No changed chat file appears in the failing set.

AI assistance

OpenAI Codex was used to investigate, implement, and test this change. The diff and validation output were reviewed before submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Input Field Responsiveness in Long Conversations

1 participant