Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add undo/redo functionality #2591 #2623

Merged
merged 9 commits into from
Nov 12, 2024

Conversation

timothycarambat
Copy link
Member

@timothycarambat timothycarambat commented Nov 12, 2024

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

@timothycarambat timothycarambat merged commit 2f56327 into master Nov 12, 2024
@timothycarambat timothycarambat deleted the feature/add-undo-functionality branch November 12, 2024 23:49
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]: Lack of Undo Functionality for Paste in Main Prompt Text Box
3 participants