Add new filtered deck options implementation
Purpose / Description
Initially, while working on #18875, I implemented the filtered deck related part outside of the (old)FilteredDeckOptions like CreateDeckDialog was doing. After thinking about this I decided that it is a better idea to implement a new screen for filtered decks following desktop behavior.
Changes:
- use material design for screen
- get away from deprecated preferences code
- automatic configuration changes handling
- slightly improve user ux as entering most values requires only two touches now
- still a bit more functionality to add to match desktop(browser search). I implemented it but this already got really big
The line count is big but two thirds of it is the layout, tests and views setup.
Video with general behavior(Don't keep activities is on):
Screen_recording_20251202_092039.webm
Images with how it looks with different themes
Fixes
- Related to #18875
How Has This Been Tested?
Manually checked the behavior against desktop behavior, ran tests.
Checklist
- [x] You have a descriptive commit message with a short title (first line, max 50 chars).
- [x] You have commented your code, particularly in hard-to-understand areas
- [x] You have performed a self-review of your own code
- [x] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
- [ ] UI Changes: You have tested your change using the Google Accessibility Scanner
[!IMPORTANT] Maintainers: This PR contains https://github.com/ankidroid/Anki-Android/labels/Strings changes
- Sync Translations before merging this PR and wait for the action to complete
- Review and merge the auto-generated PR in order to sync all user-submitted translations
- Sync Translations again and merge the PR so the huge automated string changes caused by merging this PR are by themselves and easy to review
Thank you so much!!!
From the video (no code viewed):
- The first "limit to" box doesn't bring up a numbers keyboard
- Could we add a "(?)" somewhere to explain
- Briefly what a filtered deck is
- it's the same Anki search syntax as 'Browse'.
- I don't like the buttons, I think it's partially our theme, but could we try this design instead?
If I may give my feedback:
- The titles "Filter" and "Options" should be a bit more distinguished from the other text.
- The sort selection box can be typed in?
- Use switches (not radio buttons) if the items in a list can be independently controlled.
Feedback considered:
The first "limit to" box doesn't bring up a numbers keyboard
It should now.
Could we add a "(?)" somewhere to explain
Briefly what a filtered deck is it's the same Anki search syntax as 'Browse'.
I already added a help menu item linking to the docs webpage. Adding extra TLDR text in the view feels verbose. Helpful for beginners the very first times when creating filtered decks, useless and just taking space for anyone else. Maybe some one time notification?
I don't like the buttons, I think it's partially our theme, but could we try this design instead?
Implemented it but note that I removed the Options for part of the title, there simply isn't enough space for the full original title: Options for Filtered deck 15:15. I updated the images and video at the top.
The titles "Filter" and "Options" should be a bit more distinguished from the other text.
Yes I didn't add any styling to them. They should now be more consistent, I also added extra padding to their related content, it provides better structuring IMO.
The sort selection box can be typed in?
Yes, that's how that widget works. Not enthusiastic about it either but I'm fine with it. The user can either use the dropdown to bring the popup or enter text to filter the values.
Use switches (not radio buttons) if the items in a list can be independently controlled.
Yes, thanks. I was looking too much at the desktop ui.
I think the remaining checkboxes should also be switches. Also, it would be better if all switches were below "Options", the second filter/delays were above it, and the switches font were normal weight.
If you're fine with deviating slightly from Anki Desktop
the "Name" box is unnecessary and the "Build" button could be replaced with a checkmark icon.
Turn off spellchecking in the dropdown
Can you use app:suffixText (possibly with a <plurals> here):
I updated the images.
I think the remaining checkboxes should also be switches.
Tried it and like it enough to implement it, thanks.
Also, it would be better if all switches were below "Options", the second filter/delays were above it, and the switches font were normal weight.
Did this on purpose. The second filter switch I placed outside because I don't think the desktop behavior is that great here(switch in a different place => content appearing somewhere above it). I like the local aspect of the current behavior. The delays inputs are only visible when reschedule is unchecked and again I like the local aspect of it.
the "Name" box is unnecessary
Probably but it's also consistent with all the other inputs so I'm keeping it.
and the "Build" button could be replaced with a checkmark icon.
Doesn't work, we have two cases Build and Rebuild and the text is important.
Turn off spellchecking in the dropdown Can you use app:suffixText (possibly with a
here):
Implemented both requests, but note that I used the backend string for seconds.
Note that I marked the test: building a filtered deck with no cards fails unless allow empty is checked as flaky on windows. Passed on linux every time I ran the test but in Windows CI it sometimes fails.
reviewer note: I'm expecting to review this and hopefully approve shortly but -
I'd like to wait to merge it for just about a week - until 20251217
Goal is to preserve the ability to sync strings via cherry-pick to the release branch for just a little bit after stable goes live and the initial burst of translations comes in when people notice there are new strings in the app
This PR deletes strings and that would crash the app if I cherry-pick strings sync and those removed strings were accessed by the stable branch code that still exists.