-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvement(set-due-date): simplify for FSRS by removing "set interval to same value" #17708
Conversation
This comment has been minimized.
This comment has been minimized.
I would like to pay attention to comments on the issue, especially
I do believe that giving the user no choice, vs giving the user a choice where either outcome is incorrect is the best result Jarrett agreed In future, this should be fixed upstream. Hopefully in a manner where there is no need for the checkbox |
b6370a9
to
c1e36f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, +1 on the tests, awesome
Useful if you want to assert on the exception message
It'll be used in the Set Due Date dialog for issue 17707
When FSRS is enabled, there is no reason for due date to be inconsistent with interval So, hide 'set interval to same value' and use `true` as the default value Property name: `updateIntervalToMatchDueDate` Confirmed by Jarrett and Expertium paraphrased: > Expertium: when FSRS is enabled, is there any reason for keeping `ivl` not consistent with due date? Because I'm pretty sure there isn't > Jarrett: Yeah, there isn’t. https://discord.com/channels/368267295601983490/1282005522513530952/1324758732122624020 The current backend implementation is not ideal: * `1!` => interval is set to days from today, rather than days from last review * `1` => interval does not match due date So I suspect this will be improved upstream in the future Fixes 17707
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Left one minor nitpick if you agree, merge at will otherwise.
const val MAX_WIDTH_DP = 450f | ||
|
||
@CheckResult | ||
fun newInstance(cardIds: List<CardId>) = | ||
suspend fun newInstance(cardIds: List<CardId>) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why this method needs to be suspended. If the dialog requires the fsrs status(and it does) then I think this should be made obvious in the api by having the method receiving the value as a parameter. Call sites can do the required work to properly setup this dialog instead of hiding it here.
Would probably be useful for tests as well because we could avoid having to mock getFSRSStatus().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it shouldn't be here, but it shouldn't be directly at the call site.
I wouldn't mind a new call, but it feels verbose.
If we moved to the call site:
- Each call site would be executing the same code
- FSRS status is system-supplied. The list of IDs is determined by the caller. The system supplied data isn't useful for the understanding of the code intent: "launch the dialog"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of tests: we use the arguments, so no mocks are needed
Purpose / Description
I wanted to simplify the dialog, especially explaining what "set interval to same value" due to user feedback.
But, it didn't make sense to me for FSRS.
After a sufficiently long discussion with Expertium & Jarrett, we discovered:
!
optionFixes
Approach
When FSRS is enabled, there is no reason for due date to be inconsistent with interval
So, hide 'set interval to same value' and use
true
Confirmed by Jarrett and Expertium, paraphrased:
https://discord.com/channels/368267295601983490/1282005522513530952/1324758732122624020
How Has This Been Tested?
Logs when FSRS enabled:
When disabled and unticked
Ticking the checkbox still works
Unit tests have been added
Screenshots:
Learning (optional, can help others)
Deep dives can improve the UX
Checklist