fix: Show red text if the tag already exists and disable the button#20368
fix: Show red text if the tag already exists and disable the button#20368david-allison merged 1 commit intoankidroid:mainfrom
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. |
|
Important Maintainers: This PR contains Strings changes
|
AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsDialog.kt
Outdated
Show resolved
Hide resolved
| inputET.filters = arrayOf(addTagFilter) | ||
|
|
||
| if (!prefixTag.isNullOrEmpty()) { | ||
| // utilize the addTagFilter to append '::' properly by appending a space to prefixTag |
There was a problem hiding this comment.
Why removing the comment?
There was a problem hiding this comment.
Sorry, that wasn’t intentional. I’ll add it back.
AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsDialog.kt
Outdated
Show resolved
Hide resolved
criticalAY
left a comment
There was a problem hiding this comment.
Changes are not reverted
david-allison
left a comment
There was a problem hiding this comment.
If you re-request review, it removes my approval. Still good to go
|
Got it!, Thanks |
criticalAY
left a comment
There was a problem hiding this comment.
I am ok with the code, the commit can be squashed.
Thankyou!
dab5259 to
26a9aa5
Compare
|
Maintainers: Please Sync Translations to produce a commit with only the automated changes from this PR. Read more about updating strings on the wiki, |
Purpose / Description
The PR fixes the issue where adding an already existing tag does not provide proper validation feedback.
Now the Add Tag dialog shows a red error message and disables the OK button when a duplicate tag is entered.
Fixes
Approach
Added validation in
TagsDialog.ktto check whether the entered tag already exists.TagsUtil.getUniformedTag()How Has This Been Tested?
Ran the app and verified that when entering an existing tag in the Add Tag dialog, a red error message is displayed and the OK button remains disabled.
Also verified that entering a new unique tag enables the OK button and allows the tag to be added successfully.
before:

after:

Learning (optional, can help others)
None
Links to blog posts, patterns, libraries or addons used to solve this problem
Checklist