fix: limit due date input length in SetDueDateDialog (part of #18553)#20459
Merged
BrayanDSO merged 1 commit intoankidroid:mainfrom Mar 14, 2026
Merged
Conversation
Member
|
Cheers! Got a screenshot?
Anki Default Maximum Interval: |
Contributor
Author
Contributor
|
It would be great if you directly added the screenshot to the PR description, also a small suggestion to limit the img-width when uploading it so it isn't so big. |
Contributor
Author
|
thanks for your suggestion i will keep that in mind |
Member
|
Could you edit the commit message with a brief justification of the number selected, and could I see what the 'invalid state' looks like? Does the value go to 99999, or just stop allowing more input? |
…id#18553) fix: limit due date input length in SetDueDateDialog (part of ankidroid#18553) Limit the input to 5 digits because Anki’s default maximum interval is about 100 years (~36,525 days). Allowing 5 digits supports this range while preventing extremely large values such as 1000000000 days.
7dcd2d7 to
2be2069
Compare
Contributor
Author
BrayanDSO
approved these changes
Mar 14, 2026
Collaborator
|
Thanks for contributing!
I just want to let you know that the two range inputs are already limited to 5 digits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Purpose / Description
Part of issue #18553 highlights that the "Set due date" dialog in the
Browser allows extremely large values (e.g. 1000000000 days).
This PR addresses the checklist item:
Browser → Set due date → Limit the number
An
InputFilteris added to restrict the number of digits that canbe entered in the due date input fields.
Fixes
Addresses part of #18553
Specifically fixes the following item:
Browser → Set due date:
Approach
Added
InputFilter.LengthFilterto the EditText fields inSetDueDateDialog.kt.Applied to:
This prevents extremely large values while maintaining
support for large but reasonable intervals.
How Has This Been Tested?
Tested using the debug build on an Android emulator.
Steps:
Test environment:
Learning
Reviewed the dialog implementation in
SetDueDateDialog.ktand how input changes are handled using
doOnTextChanged.Checklist
Please, go through these checks before submitting the PR.
Screenshots