Skip to content

Improve the review forgotten cards dialog#20620

Open
nourhanbakry wants to merge 5 commits intoankidroid:mainfrom
nourhanbakry:Improve-the-Review-forgotten-cards-dialog
Open

Improve the review forgotten cards dialog#20620
nourhanbakry wants to merge 5 commits intoankidroid:mainfrom
nourhanbakry:Improve-the-Review-forgotten-cards-dialog

Conversation

@nourhanbakry
Copy link
Copy Markdown
Contributor

Purpose / Description

Improve the "Review forgotten cards" dialog.

The current dialog has multiple UX issues:

  • unclear title
  • unnecessary text like "x days" in description
  • no unit shown in input field
  • generic "OK" button label
  • no inline validation feedback
  • shows error dialog instead of inline warning when no cards match

This creates confusion and breaks consistency with other dialogs.

Fixes

Approach

The dialog UI and behavior were updated to match the expected UX:

  • added a clear title "Review forgotten cards"
  • removed redundant "x days" text from description
  • added dynamic unit suffix "day/days" to the input field using getQuantityString
  • changed positive button text from "OK" to "Create"

Validation improvements:

  • prevented leading zeros using InputFilter
  • limited input length
  • disabled button when input is invalid or zero
  • added inline error messages instead of showing a dialog

Dynamic validation:

  • on each input change, a background check runs using hasMatchingCards
  • if no cards match the criteria:
    • show error message "No cards matched the criteria"
    • disable the button
  • if valid:
    • clear error
    • enable button

This ensures immediate feedback without interrupting the user flow.

How Has This Been Tested?

Tested manually with the following setup:

  • Device: Pixel 8 emulator
  • API Level: 36
  • Build Variant: playDebug
Screen.Recording.2026-03-29.at.2.30.25.AM.mov

Checklist

Please, go through these checks before submitting the PR.

  • [✅] You have a descriptive commit message with a short title (first line, max 50 chars).
  • [✅] You have commented your code, particularly in hard-to-understand areas
  • [✅] You have performed a self-review of your own code
  • [✅] 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

@github-actions
Copy link
Copy Markdown
Contributor

Important

Maintainers: This PR contains Strings changes

  1. Sync Translations before merging this PR and wait for the action to complete
  2. Review and merge the auto-generated PR in order to sync all user-submitted translations
  3. 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

@david-allison
Copy link
Copy Markdown
Member

Failing lint

https://github.com/ankidroid/Anki-Android/tree/main/.github/workflows#quality-checks

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Mar 29, 2026
@Galal-20
Copy link
Copy Markdown
Contributor

Hello @nourhanbakry
If the resource ("Invalid number") is really not needed, remove it.

@nourhanbakry
Copy link
Copy Markdown
Contributor Author

Hello @nourhanbakry If the resource ("Invalid number") is really not needed, remove it.

Thanks for your comment, I fixed it

val newText = dest?.replaceRange(dstart, dend, source?.subSequence(start, end) ?: "")

return if (newText != null && newText.length > 1 && newText.startsWith("0")) {
""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here as well : see this comment #20618 (comment)

binding.detailsEditText2Layout.error = null
dialog.positiveButton.isEnabled = true
} else {
binding.detailsEditText2Layout.error = getString(R.string.no_cards_matched_criteria)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use TR.customStudyNoCardsMatchedTheCriteriaYou instead of the string resource here to avoid duplication

@david-allison david-allison removed the Needs Author Reply Waiting for a reply from the original author label Mar 30, 2026
Copy link
Copy Markdown
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Author Reply Waiting for a reply from the original author Needs Review Strings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the Review forgotten cards dialog

4 participants