[PR #2623] [MERGED] Add undo/redo functionality #2591 #4048

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

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/2623
Author: @timothycarambat
Created: 11/12/2024
Status: Merged
Merged: 11/12/2024
Merged by: @timothycarambat

Base: masterHead: feature/add-undo-functionality


📝 Commits (9)

  • 3584649 initial work - undo works except typed keys
  • 780c7fb working but clunky code
  • 68a885a single letter and paste with no selection working
  • 729de70 add comments and keep the previous selection
  • 1dc36a3 Merge branch 'Mintplex-Labs:master' into feature/add-undo-functionality
  • 919bd13 optimizations + add redo feature
  • 5a27975 Merge branch 'master' into feature/add-undo-functionality
  • 7cd702b linting
  • c784293 Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into feature/add-undo-functionality

📊 Changes

1 file changed (+121 additions, -37 deletions)

View changed files

📝 frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx (+121 -37)

📄 Description

Pull Request Type

Original by @MrSimonC on #2591

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

Relevant Issues

resolves #2590
closes #2591

What is in this change?

This pull request addresses the issue of the lack of undo functionality for paste actions in the main prompt text box of Anything LLM. Specifically, it ensures that when users press Ctrl+Z on Windows or Command+Z on Mac after pasting text, the paste operation is undone, and the pasted text is removed from the text box. This change improves the user experience by allowing users to easily revert paste actions without manually deleting the text.

Additional Information

  • The implementation includes modifications to the event handling for the main prompt text box to correctly process Ctrl+Z and Command+Z as undo operations for paste actions.
  • Also includes implementation of redo using Ctrl+Shift+Z and Command+Shift+Z
  • Manual tests have been performed to verify that the undo functionality works as expected across pasting, and text input.
  • This update enhances the usability of the text box, aligning with common text editing behaviors found in other applications, thereby making the interaction more intuitive for users.
  • No additional dependencies were added in this PR. Existing functionality was extended to include proper handling of undo operations for pasted text.
  • Code conforms to the pattern found in the same file and prettier rules have been followed/adjusted for.

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/2623 **Author:** [@timothycarambat](https://github.com/timothycarambat) **Created:** 11/12/2024 **Status:** ✅ Merged **Merged:** 11/12/2024 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `feature/add-undo-functionality` --- ### 📝 Commits (9) - [`3584649`](https://github.com/Mintplex-Labs/anything-llm/commit/35846499406e38a454e63399fb002bd830803e60) initial work - undo works except typed keys - [`780c7fb`](https://github.com/Mintplex-Labs/anything-llm/commit/780c7fbb49f8a60ace03abedc977c812ee5ab258) working but clunky code - [`68a885a`](https://github.com/Mintplex-Labs/anything-llm/commit/68a885a01283e040fc71e88c7faa8ce3e1ad44ea) single letter and paste with no selection working - [`729de70`](https://github.com/Mintplex-Labs/anything-llm/commit/729de7085ae928ed78c21cbc25da499ad13e990c) add comments and keep the previous selection - [`1dc36a3`](https://github.com/Mintplex-Labs/anything-llm/commit/1dc36a377d3454263f2c74fa15107f017aee69d3) Merge branch 'Mintplex-Labs:master' into feature/add-undo-functionality - [`919bd13`](https://github.com/Mintplex-Labs/anything-llm/commit/919bd13240bb9a922471f11abc9626b7ca6ed7c8) optimizations + add redo feature - [`5a27975`](https://github.com/Mintplex-Labs/anything-llm/commit/5a2797584c8277a57c40fac060888d665c88229c) Merge branch 'master' into feature/add-undo-functionality - [`7cd702b`](https://github.com/Mintplex-Labs/anything-llm/commit/7cd702b7d31022107fd59c7c7c2e68944a5d6c6d) linting - [`c784293`](https://github.com/Mintplex-Labs/anything-llm/commit/c78429395fef3d4124b451b1d5f5ec0a46ba0a16) Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into feature/add-undo-functionality ### 📊 Changes **1 file changed** (+121 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx` (+121 -37) </details> ### 📄 Description ### Pull Request Type Original by @MrSimonC on #2591 <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat - [x] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #2590 closes #2591 ### What is in this change? This pull request addresses the issue of the lack of undo functionality for paste actions in the main prompt text box of Anything LLM. Specifically, it ensures that when users press `Ctrl+Z` on Windows or `Command+Z` on Mac after pasting text, the paste operation is undone, and the pasted text is removed from the text box. This change improves the user experience by allowing users to easily revert paste actions without manually deleting the text. ### Additional Information - The implementation includes modifications to the event handling for the main prompt text box to correctly process `Ctrl+Z` and `Command+Z` as undo operations for paste actions. - Also includes implementation of redo using `Ctrl+Shift+Z` and `Command+Shift+Z` - Manual tests have been performed to verify that the undo functionality works as expected across pasting, and text input. - This update enhances the usability of the text box, aligning with common text editing behaviors found in other applications, thereby making the interaction more intuitive for users. - No additional dependencies were added in this PR. Existing functionality was extended to include proper handling of undo operations for pasted text. - Code conforms to the pattern found in the same file and prettier rules have been followed/adjusted for. ### 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:35:02 -05:00
yindo closed this issue 2026-02-22 18:35:02 -05:00
yindo changed title from [PR #2623] Add undo/redo functionality #2591 to [PR #2623] [MERGED] Add undo/redo functionality #2591 2026-06-05 15:16:33 -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#4048