Improve the review forgotten cards dialog#20620
Improve the review forgotten cards dialog#20620nourhanbakry wants to merge 2 commits intoankidroid:mainfrom
Conversation
|
Important Maintainers: This PR contains Strings changes
|
|
Hello @nourhanbakry |
Thanks for your comment, I fixed it |
There was a problem hiding this comment.
This is taking on too much, please fix the commit structure via rebase + force push so individual changes are reviewable as separate commits or split out maybe 2 smaller PRs so they're reviewable
This feels AI-genned, could I confirm it's not? The use of bare strings, where your previews PRs contained R.string seemed unusual
https://github.com/ankidroid/Anki-Android/blob/main/AI_POLICY.md
- Fixed translation issues - Updated multiple string resources - Applied lint fixes
Thank you for the feedback. Regarding the commit structure, I apologize for the clutter. I will work on rebasing the branch to clean up the history and ensure each commit represents a logical, reviewable change. As for the strings, I assure you this is not AI-generated. I used bare strings temporarily during development and intended to move them to R.string before finalizing, but I clearly missed that step. I will fix them to use string resources as per the project standards. I’ll ping you again once the rebase and the fixes are pushed. Thanks for your patience! |
|
Cheers! Please un-draft when it's ready for review |
67127a8 to
ec8eca1
Compare
Thank you, it's open now could you please take a look? |
| withCol { | ||
| val currentDeckName = decks.name(viewModel.deckId) | ||
|
|
||
| val hasForgottenCards = |
There was a problem hiding this comment.
What's the source of this code?
There was a problem hiding this comment.
@Galal-20 This looks very similar to your code:
What's going on?
There was a problem hiding this comment.
@Galal-20 This looks very similar to your code:
What's going on?
Thanks for pointing this out.
Yes, after reviewing the code, the implementations look very similar.
But I would like to clarify something important:
this was written independently from my perspective in my PR, based on Anki’s search (e.g., deck filtering, prop:due queries, filtering, numeric input validation, handling leading zeros, and basic UI state updates), which naturally leads to very similar results.
I just wanted to highlight that the logic here is fairly standard, so some overlap in approach is expected.
I hope this clarifies the situation.
There was a problem hiding this comment.
What's the source of this code?
I appreciate you bringing this up.
The logic here is mainly based on Anki’s search system, which I used as the primary reference while implementing this part.
While working on it, I also noticed that @Galal-20 had a similar issue and solution in his PR, which helped me better understand the expected behavior. So his approach influenced my thinking, but I reimplemented the logic myself to fit my current changes.
Since the problem and constraints are the same, it’s natural that the implementations look very similar.
Let me know if you’d like me to adjust anything here.
| } | ||
| } | ||
|
|
||
| private suspend fun hasMatchingCards( |
There was a problem hiding this comment.
The name doesn't provide context for what it does
There was a problem hiding this comment.
The name doesn't provide context for what it does
You’re right, the current name doesn’t clearly describe what the function is actually checking.
This function is specifically used for the STUDY_FORGOT case.
It validates the user input, then checks whether there are any cards in the current deck that match the search query rated:$value:1 (forgotten cards within the given range).
The result is used to decide whether to enable the positive button or show an error if no cards match the criteria.
I’m thinking of renaming it to (hasForgottenCardsMatchingInput) as its more descriptive name from my point of view since it reflects both the condition and the dependency on the user input.
Do you think this makes the intent clearer? if this name suitable and clear, ping me to rename it.
|
cbbaec1#r3037507014 makes me feel uneasy. Closing this PR after a discussion with the maintainers. Two PRs sharing code this closely without attribution is not normal. If code is being borrowed, mention it in the commit message |
Purpose / Description
Improve the "Review forgotten cards" dialog.
The current dialog has multiple UX issues:
This creates confusion and breaks consistency with other dialogs.
Fixes
Approach
The dialog UI and behavior were updated to match the expected UX:
getQuantityStringValidation improvements:
InputFilterDynamic validation:
hasMatchingCardsThis ensures immediate feedback without interrupting the user flow.
How Has This Been Tested?
Tested manually with the following setup:
playDebugScreen.Recording.2026-03-29.at.2.30.25.AM.mov
Checklist
Please, go through these checks before submitting the PR.