Skip to content

ReviewRemindersScope for ScheduleReminders entry#18829

Merged
david-allison merged 1 commit intoankidroid:mainfrom
ericli3690:ericli3690-review-reminders-get-intent
Jul 10, 2025
Merged

ReviewRemindersScope for ScheduleReminders entry#18829
david-allison merged 1 commit intoankidroid:mainfrom
ericli3690:ericli3690-review-reminders-get-intent

Conversation

@ericli3690
Copy link
Member

@ericli3690 ericli3690 commented Jul 10, 2025

Purpose / Description

  • Refactored ScheduleReminders to take a ReviewReminderScope as an argument in getIntent to better enforce that callers should either trigger ScheduleReminders in deck-specific or global mode rather than leaving open the possibility of passing an incorrect deckId, etc. This was recommended by David.
  • Made toolbar title use ReviewReminderScope to follow the above change
  • Modified review reminder entry points to pass a ReviewReminderScope rather than the old getIntent arguments

Fixes

  • For GSoC 2025: Review Reminders

Approach

  • I'm actually quite happy with this change, it feels very elegant. Both ReviewReminder and ScheduleReminders are now using the same sealed class to communicate a "scope", whereas previously they were each using slightly different methods to accomplish the same "scoping" functionality. This commit unifies the "scope" feature.

How Has This Been Tested?

  • Tested on a physical Samsung S23, API 34.

Checklist

  • 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

@ericli3690 ericli3690 added Needs Review GSoC Pull requests authored by a Google Summer of Code participant [Candidate/Selected], for GSoC mentors labels Jul 10, 2025
@david-allison
Copy link
Member

Heya, could you rebase the @ out the commits - leads to tons of notifications

@ericli3690
Copy link
Member Author

Oops, my bad, super sorry!

GSoC 2025: Review Reminders

- Refactored ScheduleReminders to take a ReviewReminderScope as an argument in `getIntent` to better enforce that callers should either trigger ScheduleReminders in deck-specific or global mode rather than leaving open the possibility of passing an incorrect deckId, etc. This was recommended by David.
- Made toolbar title use ReviewReminderScope to follow the above change
- Modified review reminder entry points to pass a ReviewReminderScope rather than the old `getIntent` arguments
@ericli3690 ericli3690 force-pushed the ericli3690-review-reminders-get-intent branch from 04ef12e to bc66bf8 Compare July 10, 2025 04:18
@david-allison
Copy link
Member

No worries! Cheers

Copy link
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.

LGTM, cheers!

decks.name(did)
}
}
private fun reloadToolbarText() {
Copy link
Member

Choose a reason for hiding this comment

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

optional: may not require a method - only called once

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, but I'll keep it separated for now. I originally pulled it out because it was used when switching multi-select mode on and off. Perhaps we could remove it now that I'm getting rid of multi-select, but onViewCreated() is about to get QUITE long so I'll keep it pulled out into a submethod for readability's sake. Thanks!

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Jul 10, 2025
Copy link
Contributor

@criticalAY criticalAY left a comment

Choose a reason for hiding this comment

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

LGTM!

@criticalAY criticalAY added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Jul 10, 2025
@david-allison david-allison added this pull request to the merge queue Jul 10, 2025
Merged via the queue into ankidroid:main with commit d2d121a Jul 10, 2025
9 checks passed
@github-actions github-actions bot added this to the 2.22 release milestone Jul 10, 2025
@github-actions github-actions bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Pull requests authored by a Google Summer of Code participant [Candidate/Selected], for GSoC mentors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants