-
-
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
Adding tags to deck/multiple notes #4911
Comments
How do you propose this might be implemented in terms of the GUI? |
I think it'd be simple to do this, just add a "add tag" item to the multi-select menu and create a corresponding logic in DeckTask. |
What about removing tags? I think you'd want to use the tag editor |
@timrae Maybe in the deck options screen? |
Definitely not in the deck options screen, I think it would need to use the tag editor like we do when adding / removing tags in the editor. |
I've been missing a way to tag/untag and export the cards currently filtered in the browser view. |
My vote is to call the tag editor like @timrae said, but from the drop down menu that appears when long pressing a note in the browser. Maybe right below "Select all"? |
If the project maintainers approve, I'd like to try implementing this in the card browser context menu as shown in my screenshot above. My initial research shows that this menu is defined in CardBrowserContextMenu.java. In the betas there's already functionality to toggle the 'marked' tag, so maybe I'll reuse code from there and create an instance of the TagsDialog. I'm struggling to find com.ichi2.anki.R which is used by CardBrowserContextMenu.java to toggle the marked tag. Shouldn't it be located in the com/ichi2/anki directory? EDIT: In DeckTask.java, MARK_NOTE_MULTI calls CardUtils.markAll |
The 'R' symbol is actually dynamically generated at build time, and stands for "Resources", the contents are built from src/main/res XML files Doing these 'Task' type features is a little involved because it is asynchronous while in my previous additions I've still tried to preserve undo while being aware of memory pressure jus tin case. But there are plenty of patterns to follow, yes - like you see with the DeckTask/MARK_NOTE_MULTI items. They are all pretty much the same so hopefully not too terrible to hack on @sudomain you're approach in general (call tag editor, from card list menu in multi-select mode) seems like it should work |
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
Adding multiple tags in Card Browser is requested fairly often, and I'd like to get around to it |
There is an old method in AnkiDroid's port of libanki that would theoretically handle bulk adding of tags, though it's currently broken. For reference, the corresponding function in desktop Anki calls a function in the rust backend. If someone were to make an attempt at this feature, should the approach be to port the rust code to java as discussed in #5805 ? |
+1 |
I would like to work on this one, if it's still a wanted feature. I will make a change to the tags dialog, will add another state that will be visible, if multiple notes are selected.
In desktop, they don't have this issue, as there is only 2 options from the card browser, add tags, or remove tags |
That sounds good @TarekkMA - as long as nothing is actually persisted to the database until the change is confirmed with an explicit save and there is the option to cancel this works for me. As an implementation detail, this will need to be done as an AsyncTask with a progress listener because it's touching storage (slow) and the UI will become unresponsive unless it's off in another task, but the UI does need to block (thus the progress listener and a progress dialog) as the CardBrowser will not have a valid state until the oepration is done, at which point it will need to reload itself to show the result of the current search with new tags |
@mikehardy no problems, will make that. |
There is a library https://github.com/sevar83/indeterminate-checkbox that does have tri-state checkbox with animation transition. But not maintained. We could fork it, or make our own with no animations, I don't know anything about vector animation in android. |
We will not adopt external dependencies unless they are maintained, and we are busy enough now, fork+maintain is not a good option. I don't think animation has any value here (in fact, if we animate anything we also have to support disabling the animation since we are used on e-ink readers!) |
The next alpha build will have a tags editor that works on multiple things at once |
Research
Enter an [ x ] character to confirm the points below:
[ x ] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
[ x ] I have checked the manual and the FAQ and could not find a solution to my issue
[ x ] I have searched for similar existing issues here and on the user forum
Being able to add tags to an entire deck and/or multiple notes simultaneously would be a time saver. I see that @vrublack is working on multiple note selection but I didn't notice anything on adding tags.
The text was updated successfully, but these errors were encountered: