Skip to content

fix(desktop): avoid idle chat history re-renders - #38474

Closed
hdd69 wants to merge 1 commit into
NousResearch:mainfrom
hdd69:fix/desktop-idle-chat-rerenders
Closed

fix(desktop): avoid idle chat history re-renders#38474
hdd69 wants to merge 1 commit into
NousResearch:mainfrom
hdd69:fix/desktop-idle-chat-rerenders

Conversation

@hdd69

@hdd69 hdd69 commented Jun 3, 2026

Copy link
Copy Markdown

Summary

Desktop's parent controller can re-render while chat is idle, for example from background status polling. Before this change, those parent renders passed fresh callback props into ChatView, rebuilt the assistant runtime adapter, and caused the mounted assistant-ui thread/chat history to re-render even when $messages had not changed.

This stabilizes the idle chat path by:

  • memoizing ChatView
  • stabilizing DesktopController -> ChatView callback props
  • memoizing the assistant runtime adapter
  • only updating the incremental external-store runtime adapter when the adapter object changes
  • adding a regression test that a parent idle tick does not re-render mounted chat history

This is intentionally scoped to idle render isolation. It does not change the scroll-anchor logic.

Test Plan

  • npm run test:ui -- src/app/chat/index.test.tsx
  • npm run test:ui -- src/components/assistant-ui/streaming.test.tsx
  • npm run type-check

@alt-glitch alt-glitch added type/perf Performance improvement or optimization duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have labels Jun 3, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #38470 (same author, same four apps/desktop files, near-identical diff differing only by a blank line). Consolidating on #38470 as the canonical PR.

@hdd69

hdd69 commented Jun 3, 2026

Copy link
Copy Markdown
Author

Duplicate of #38470 (same author, same four apps/desktop files, near-identical diff differing only by a blank line). Consolidating on #38470 as the canonical PR.

This is true indeed. It was done per mistake and I apologize for that. Closing this one.

@hdd69 hdd69 closed this Jun 3, 2026
@hdd69
hdd69 deleted the fix/desktop-idle-chat-rerenders branch June 3, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have type/perf Performance improvement or optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants