Closed
Conversation
|
First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible. |
Contributor
|
Important Maintainers: This PR contains Strings changes
|
… feature-undo-function
Member
|
Thanks so much for the enthusiasm/PR! In future, could you chat in Discord before taking on a new feature which doesn't have an accepted issue
Given this is going to be a fair amount of work (both from an implementer and reviewer) on a screen which will be removed, I'm going to preemptively close this pull request. I TRULY appreciate the effort, please do get in touch on Discord/make an issue/forum thread and we'll do our best to find a feature/PR to get into the codebase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose / Description
Adding an undo feature is a standard quality-of-life improvement for any text editor. While it particularly helps on devices where handwriting recognition or pen input might lead to accidental changes, it universally benefits users who make typing mistakes, paste incorrectly, or wish to revert formatting.
This change aims to enhance the text editing experience within the Note Editor by providing an easy way to undo recent modifications to fields.
Approach
This feature is implemented by introducing a new "Undo" button to the Note Editor toolbar. The technical approach involves:
TextWatcherwith a debounce mechanism to consolidate rapid typing or multiple small changes into a single, undoable action, providing a smoother undo experience similar to desktop text editors.How Has This Been Tested?
I performed extensive manual testing on two physical Android devices:
Testing Steps:
The undo functionality worked satisfactorily on both devices and for all tested scenarios.
Automated Tests:
Automated tests were run (
connectedPlayDebugAndroidTest). The report atfile:///home/guilherme/coding/mobile/Anki-Android/AnkiDroid/build/reports/androidTests/connected/debug/flavors/play/index.htmlshows 15 failing tests. I am aware of these failures and will analyze them further, but I believe they are outside the scope of this feature's direct implementation and are likely regressions that need to be addressed separately.Screenshots
Screenshot of the Note Editor toolbar with the new Undo button:

Checklist
Please, go through these checks before submitting the PR.