[PR #4941] [MERGED] Refactor: Remove redundant message state sync in ChatContainer #4840

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

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4941
Author: @shatfield4
Created: 1/29/2026
Status: Merged
Merged: 2/9/2026
Merged by: @timothycarambat

Base: masterHead: 4940-refactor-remove-redundant-message-state-in-chatcontainer


📝 Commits (3)

  • 1149ca2 remove redundant message state sync in ChatContainer
  • 374d97a Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into 4940-refactor-remove-redundant-message-state-in-chatcontainer
  • bc0818b small lint

📊 Changes

3 files changed (+8 additions, -27 deletions)

View changed files

📝 frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx (+0 -4)
📝 frontend/src/components/WorkspaceChat/ChatContainer/index.jsx (+7 -15)
📝 frontend/src/hooks/usePromptInputStorage.js (+1 -8)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4940

  • Fixes the pending chat indicator (3 dot animation) rerendering/flickering when typing in the input while waiting for a
    response
  • message state in ChatContainer was updating on every keystroke, causing unnecessary rerenders of the entire chat history including the pending indicator (pending indicator was the only visible bug but the entire history was actually rerendering)
  • Removed redundant message state sync since PromptInput already maintains its own local state and now reads from DOM on submit instead

What is in this change?

Additional Information

  • Sent regular chat and no longer rerenders 3 dot animation while message is pending
  • Test STT in both auto submit and append mode
  • Localstorage draft messages store properly
  • Slash commands pops up on / typed into chat input
  • Agent meny pops up on @ typed into chat input
  • Pasted text pastes properly
  • Undo/redo works properly
  • Enter to submit chat, shift + enter creates new line

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 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/4941 **Author:** [@shatfield4](https://github.com/shatfield4) **Created:** 1/29/2026 **Status:** ✅ Merged **Merged:** 2/9/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `4940-refactor-remove-redundant-message-state-in-chatcontainer` --- ### 📝 Commits (3) - [`1149ca2`](https://github.com/Mintplex-Labs/anything-llm/commit/1149ca2d74e7eb9715fa0565337d193de4c019c1) remove redundant message state sync in ChatContainer - [`374d97a`](https://github.com/Mintplex-Labs/anything-llm/commit/374d97ababc5f4bfcbd5008ca8d9e69fd4e084ec) Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into 4940-refactor-remove-redundant-message-state-in-chatcontainer - [`bc0818b`](https://github.com/Mintplex-Labs/anything-llm/commit/bc0818b9c7d778342a6f52004499690a0807ce5e) small lint ### 📊 Changes **3 files changed** (+8 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx` (+0 -4) 📝 `frontend/src/components/WorkspaceChat/ChatContainer/index.jsx` (+7 -15) 📝 `frontend/src/hooks/usePromptInputStorage.js` (+1 -8) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat - [ ] 🐛 fix - [x] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4940 - Fixes the pending chat indicator (3 dot animation) rerendering/flickering when typing in the input while waiting for a response - `message` state in ChatContainer was updating on every keystroke, causing unnecessary rerenders of the _entire chat history_ including the pending indicator (pending indicator was the only visible bug but the entire history was actually rerendering) - Removed redundant `message` state sync since PromptInput already maintains its own local state and now reads from DOM on submit instead ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> - [x] Sent regular chat and no longer rerenders 3 dot animation while message is pending - [x] Test STT in both auto submit and append mode - [x] Localstorage draft messages store properly - [x] Slash commands pops up on `/` typed into chat input - [x] Agent meny pops up on `@` typed into chat input - [x] Pasted text pastes properly - [x] Undo/redo works properly - [x] Enter to submit chat, shift + enter creates new line ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <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:38 -05:00
yindo closed this issue 2026-02-22 18:36:38 -05:00
yindo changed title from [PR #4941] Refactor: Remove redundant message state sync in ChatContainer to [PR #4941] [MERGED] Refactor: Remove redundant message state sync in ChatContainer 2026-06-05 15:20:38 -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#4840