Improve the Study by card state or tag dialog
The Study by card state or tag dialog
- [ ] Add a title "Study by card state or tag".
- [ ] Remove "Select x cards from the deck".
- [ ] Add "Number of cards" to the border of the text field (see reference).
- [ ] ~~Add a unit "card"/"cards" to the box~~.
- [ ] Change the text selection like in https://github.com/ankidroid/Anki-Android/pull/20551.
- [ ] Replace "Select" with "Create".
- [ ] If the resulting filtered deck is empty (i.e., no cards match the criteria), a red warning should appear and the button should be disabled, instead of an error dialog (see reference).
- Also, make sure this bug is fixed: when there are no cards matching some selections like "Due cards only", a filtered deck with of new cards is created.
- [ ] Show a warning when the input is invalid, limit the digits, and prevent leading zeros, like in https://github.com/ankidroid/Anki-Android/pull/20520, except without input steppers.
Reference dialogs
I'd like to work on this issue. Can you please assign it to me?
Hi, I’ve created a PR for this issue.
Can I be assigned to this issue? Just to confirm, 'card/cards' unit shouldn't be added right?
Card[s] should not be added as-per @ZornHadNoChoice 's request.
I suspect there's not enough horizontal space
Yeah, I didn't like how it looked in the closed PR: https://github.com/ankidroid/Anki-Android/pull/20615#issuecomment-4147810233.
Hello @ZornHadNoChoice, I have a few questions regarding showing the inline red warning
I implemented a check that runs when the user clicks 'Choose Tags' in the input dialog. If the card count is 0, it shows the red warning and stops the process rather than disabling the button while user is typing. I felt this was more efficient as card limit input doesn't affect whether the state is empty. Is this approach fine?
Also, in the case where user proceeds with tag selection but chooses a tag that results in no cards, the standard error dialog still appears. Do we want to keep that dialog as is, or should that be removed too? If we do want to remove it, we would likely need some filtering step to only show tags that have cards for that specific selection...
https://github.com/user-attachments/assets/f47a813c-7c59-420c-bba1-83fc33f4a524
The warning appears around the number text field which isn't the problem as you noted. I think it would be better if it appeared under the selection right when the user makes the selection. The button can then be disabled.
I like the idea of filtering the tags better.
An alternative I had in mind is to put a box in the "Study by card state or tag" dialog for tag selection, just like the one in the note editor. The button would then be "Create".
@ZornHadNoChoice I implemented both flows
Option 1: Just filters the TagsDialog based on the selected card state
https://github.com/user-attachments/assets/fadcf79e-25d5-4abf-906e-a03b31b1ec4f
Option 2: Uses a tag selection box as you suggested. This one also filters the TagsDialog, and the box is enabled/disabled based on tag availability
https://github.com/user-attachments/assets/23b3560e-df7a-43b0-b972-70b22e4fcfa5
Which one seems better? I'll create a PR for whichever you prefer and adjust the design if needed
I don't like how the "Choose tags" button can actually create the deck with the first approach.
The second approach is nicer in my opinion (not sure if the maintainers are going to like it), but the tags shouldn't be completely cleared when changing the selection. Only those that aren't available with the new selection should be removed.
Hello 👋, this issue has been opened for more than 3 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
There's already a PR, bad bot.
Hi! I'm new to contributing to AnkiDroid and I'd like to work on this issue if it's still available.
There's already a PR...
Hi @ZornHadNoChoice, just to check if the issue's PR is still open and resolved? If not, then can i do it?
Yes. The maintainers just haven't got to review it yet.
Hi! This PR is still active, and I'll resolve the conflicts in the coming week. Thanks!
Ping me if you need anything, I have a lot more capacity now