refactor: use MenuProvider in StudyOptionsActivity, remove starting reviewer in undo#21339
Conversation
39d6ae5 to
9313e44
Compare
|
Snapshot diff report vs
All 16 changed screenshotsAddEditReminderDialogScreenshotTest
PreferencesScreenshotTest
ReviewRemindersScreenshotTest
|
|
@david-allison This is a follow up addressing your comment here: #21140 (comment) Or at least, that's what this PR was initially supposed to be. I don't think I read your comment carefully enough at first haha and I ended up just doing a little refactor cleanup before realizing that you wanted to separate out the Your original comment annotated StudyOptionsActivity and mentions showing the undo button conditionally by checking whether the activity is fragmented rather than by doing Perhaps what you mean instead is that we should have StudyOptionsFragment own the undo button rather than having StudyOptionsActivity own it? But that then causes problems when StudyOptionsFragment is in a right-side panel on wide screens, as its undo button ID will collide with the DeckPicker activity's undo button ID, even if we hide one of them. What we must do is use a completely different ID rather than I think the original reason why the undo button is located in StudyOptionsActivity is because it's mutually exclusive with DeckPicker's undo button (they're different activities) so we don't need any complex fragmentation checks if we just have one undo button in DeckPicker's menu and one undo button in StudyOptionsActivity's menu. If we move it to StudyOptionsFragment, then all of a sudden we need fragmentation checks. Come to think of it, why does StudyOptionsActivity need an undo button anyways? The only use I see is for undoing custom study choices like increasing the today's new cards... actually, I guess that's useful, nevermind. Perhaps the best decision is just what the UI streamlining PR already has? I.e.: undoMenuItem.isVisible = undoState.hasAction && (currentFragment is StudyOptionsFragment)The above comment is a bit stream-of-consciousness, sorry about that, but would love to hear your thoughts. Even if we do nothing to address the |
| R.id.action_undo -> { | ||
| launchCatchingTask { | ||
| undoAndShowSnackbar() | ||
| // TODO why are we going to the Reviewer from here? Desktop doesn't do this |
There was a problem hiding this comment.
This comment was originally added by @lukstbit at dd4c35d. The code to open the reviewer was initially added in 3e7ad6a9e6. I see no reason to keep it. The behaviour of the undo button seems simpler if we just... only perform the undo. The desktop reviewer doesn't open the reviewer when undo is pressed from the study options view, so lukstbit's point is valid.
9313e44 to
34fac85
Compare
…eviewer in undo Move to using the modern MenuProvider system for the undo button in StudyOptionsActivity. Also, removed starting the reviewer when undo is clicked, addressing a pending TODO comment. It was initially added here ankidroid@3e7ad6a9e6 but doesn't match Desktop behavior. I think it's probably safe to delete, tested it and I see now issues. Assisted-by: Claude Sonnet 4.5
34fac85 to
91b20bb
Compare
Note
Assisted-by: Claude Sonnet 4.5
Purpose / Description
Fixes
Originally created as a response to one of David's comments:
See below for discussion of David's concern above.
Approach
How Has This Been Tested?
Checklist