-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat: Edit tags of a multiple notes / deck #8751
Conversation
0ee0b30
to
8f09a28
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this, thanks!
AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsDialog.java
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsDialogListener.java
Show resolved
Hide resolved
AnkiDroid/src/test/java/com/ichi2/anki/dialogs/tags/TagsListTest.java
Outdated
Show resolved
Hide resolved
93bce3d
to
2969f52
Compare
boolean lhsChecked = isChecked(lhs); | ||
boolean rhsChecked = isChecked(rhs); | ||
boolean lhsChecked = isChecked(lhs) || isIndeterminate(lhs); | ||
boolean rhsChecked = isChecked(rhs) || isIndeterminate(rhs); | ||
|
||
if (lhsChecked != rhsChecked) { | ||
// checked tags must appear first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now indeterminate tags have the same priority as checked when sorting, should we make checked then indeterminate then unchecked?
dfeabe6
to
9e116bf
Compare
Added a test to test all tag variations are showing as expected. |
@TarekkMA looks like this needs re-basing as we're unwinding your stack of chained PRs - if you have a moment (and I understand it might be exam times for you! no pressure, it's not urgent) could you re-push this ? |
I have just finished my exams, I will give this PR a look and repush. |
f6ef727
to
edcad4f
Compare
@david-allison-1 what do you think on this one? The test cover is really good, and it's a feature that is highly requested. I'd like to merge this to rescue it from entropy and deliver a great feature |
Can this wait until Sunday? I don't have the free time to give this an appropriate amount of review or testing. Ping me if I don't look at this by Monday |
Oh sure! Not a rush per se, just a statement of intention that I'd like it to not rot |
this will be used to get updated tags in case there are indeterminate tags
onSelectedTags now returns list of `indeterminateTags`, the indeterminateTags should be ignored if not needed.
this should have no effect on normal call with only checked tags
based on TagsDialogListenerAction the listener callback will do different things for now the only action doable is FILTER action
now the name and comment reflects the meaning of the tags since we can add/remove tags from multiple notes using this dialog type
Select multiple cards and change the tags of their notes
97e8706
to
ae75405
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and this looks good
Arrays.asList("aA", "bb", "cc", "dd", "ff"), list.copyOfAllTagList()); | ||
assertEquals("Checked tags list should not contain any duplicates (case insensitive)", | ||
Arrays.asList("ff"), list.copyOfCheckedTagList()); | ||
assertEquals("Checked tags list should not contain any duplicates (case insensitive)\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems logically correct, but it's handled by the above assert
Okay, deep breath, here we go |
Hi there! November OpenCollective Notice Apologies for the delay, and if you're already submitted something to OpenCollective for PRs merged in November 2021, you may feel free to ignore this and it will be processed shortly Just a friendly notice that we try to process OpenCollective payments monthly - it's time for November 2021 submissions If you are interested in compensation for this work, the process with details is here: (I only post one comment per person to avoid spamming you, regardless of the number of PRs merged, but this note applies to all PRs merged for in the month of August) Thanks! |
@TarekkMA !!! We finally landed this one ❤️ |
This is awesome, thank you guys for your reviews and guidance. |
Based on #8766
Pull Request template
Purpose / Description
The final PR of the TagsDialog refactoring series :D,
Fixes
Fixes #4911
Approach
Tags that are checked in all selected notes will appear as checked, if some notes have a tag but others don't then the tags are classified as indeterminate.
CheckBoxTriStates
A tristate checkbox (Like this one in flutter) was needed to display the 3 states the tag can be (checked, unchecked, indeterminate).
I added a
cycleBackToIndeterminate
property on the tristate checkbox, so if the user clicked on the checkbox it doesn't cycle back to an indeterminate state.Used icons are the provided material ones in android studio
TagsUtil#getUpdatedTags
The code used to extract the updated tags from (prev, selected, indeterminate) lists.
TagsList
is now aware of the concept of indeterminate tags (updated all tested)
UpdateMultipleNotes
new task for updating multiple notes
How Has This Been Tested?
Unit tests
Checklist
if
statements)