[PR #4897] [MERGED] fix: prevent Citations UI glitching during streaming chats #4811

Closed
opened 2026-02-22 18:36:35 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4897
Author: @nehaaprasad
Created: 1/23/2026
Status: Merged
Merged: 1/29/2026
Merged by: @timothycarambat

Base: masterHead: fix/cit-UI-strm


📝 Commits (10+)

  • 939b698 fix: prevent Citations UI glitching during streaming chats
  • 0c5a055 replaced random keys with stable keys
  • c73f8ca Merge branch 'master' into fix/cit-UI-strm
  • 00eaf4b simplify citation glitch fix
  • 6cdfde9 Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into pr-4897-branch
  • ba8c6f2 Merge branch 'master' into fix/cit-UI-strm
  • 6fb76fb Merge branch 'master' into fix/cit-UI-strm
  • e5d6616 Remove unneeded memo()
  • 7b99df5 Simplify key logic
  • 430e417 Replace Boolean(source) with !!source

📊 Changes

3 files changed (+11 additions, -12 deletions)

View changed files

📝 frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Citation/index.jsx (+9 -10)
📝 frontend/src/utils/chat/index.js (+1 -1)
📝 server/utils/AiProviders/cohere/index.js (+1 -1)

📄 Description

Pull Request Type

  • 🐛 fix

Relevant Issues

resolves #4886

What is in this change?

  • fixed Citations UI glitching when expanded during streaming chats. Problem was streaming chunks kept updating sources with empty arrays, causing constant re-renders. Now only updates sources when they have real data.

Additional Information

  • changed handleChat in frontend/src/utils/chat/index.js to skip empty sources during streaming.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4897 **Author:** [@nehaaprasad](https://github.com/nehaaprasad) **Created:** 1/23/2026 **Status:** ✅ Merged **Merged:** 1/29/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `fix/cit-UI-strm` --- ### 📝 Commits (10+) - [`939b698`](https://github.com/Mintplex-Labs/anything-llm/commit/939b698a13435a8571a638c6e1393c3783ff3d94) fix: prevent Citations UI glitching during streaming chats - [`0c5a055`](https://github.com/Mintplex-Labs/anything-llm/commit/0c5a055a93729b484217f4d32b815e0929300196) replaced random keys with stable keys - [`c73f8ca`](https://github.com/Mintplex-Labs/anything-llm/commit/c73f8ca836472442d7843580fc8376344911ad14) Merge branch 'master' into fix/cit-UI-strm - [`00eaf4b`](https://github.com/Mintplex-Labs/anything-llm/commit/00eaf4b4b70adcd8eb27b706754d0f407945aebd) simplify citation glitch fix - [`6cdfde9`](https://github.com/Mintplex-Labs/anything-llm/commit/6cdfde9b14d8d14743207a310ee8eafbc99bb88b) Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into pr-4897-branch - [`ba8c6f2`](https://github.com/Mintplex-Labs/anything-llm/commit/ba8c6f2c5bf31d75c04dd5b8143b2f13bbe0fa2f) Merge branch 'master' into fix/cit-UI-strm - [`6fb76fb`](https://github.com/Mintplex-Labs/anything-llm/commit/6fb76fbc689acfea2c8ccb8ba4a49b81b246c527) Merge branch 'master' into fix/cit-UI-strm - [`e5d6616`](https://github.com/Mintplex-Labs/anything-llm/commit/e5d6616265239f7e52b1d0b18bfa519a4bc62fa1) Remove unneeded memo() - [`7b99df5`](https://github.com/Mintplex-Labs/anything-llm/commit/7b99df5d50c494506d0bc09398a49b79a79c1fee) Simplify key logic - [`430e417`](https://github.com/Mintplex-Labs/anything-llm/commit/430e417fcb7eedc45e4fe3c5ce213db453a6cfaf) Replace Boolean(source) with !!source ### 📊 Changes **3 files changed** (+11 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Citation/index.jsx` (+9 -10) 📝 `frontend/src/utils/chat/index.js` (+1 -1) 📝 `server/utils/AiProviders/cohere/index.js` (+1 -1) </details> ### 📄 Description ### Pull Request Type - [x] 🐛 fix ### Relevant Issues resolves #4886 ### What is in this change? - fixed Citations UI glitching when expanded during streaming chats. Problem was streaming chunks kept updating sources with empty arrays, causing constant re-renders. Now only updates sources when they have real data. ### Additional Information - changed `handleChat` in `frontend/src/utils/chat/index.js` to skip empty sources during streaming. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:35 -05:00
yindo closed this issue 2026-02-22 18:36:35 -05:00
yindo changed title from [PR #4897] fix: prevent Citations UI glitching during streaming chats to [PR #4897] [MERGED] fix: prevent Citations UI glitching during streaming chats 2026-06-05 15:20:30 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4811