Repository navigation
feat(reminders): threshold filters - #19156
david-allison merged 8 commits into
Conversation
1ca08cc to
0793e7a
Compare
0793e7a to
f2c9dde
Compare
|
5a3ddeb to
a390cfb
Compare
|
a390cfb to
9a53408
Compare
|
9a53408 to
ae683e5
Compare
|
Forgot to stage some code. Fixed. |
ae683e5 to
e128d8a
Compare
|
Rebased, fully unblocked, and ready for review! |
|
Snapshot diff report vs
All 4 changed screenshotsAddEditReminderDialogScreenshotTest
|
e1f9525 to
2152821
Compare
Well, that certainly was a little longer than a few days 😆 @david-allison Ready for review! I found a few bugs / missing unit tests in the migration code and had to patch them up too. See the commit messages and PR description for more information. The PR description screenshot has ben updated, too.
|
| "learn", // R.string.add_edit_reminder_threshold_filter_learning_review_state | ||
| // TR.cardStatsReviewLogTypeLearn() | ||
| // TR.decksLearnHeader() | ||
| "new", // R.string.add_edit_reminder_threshold_filter_new_review_state | ||
| // TR.actionsNew() | ||
| // TR.changeNotetypeNew() | ||
| // TR.statisticsCountsNewCards() | ||
| "review", // R.string.add_edit_reminder_threshold_filter_reviewing_review_state | ||
| // TR.browsingSidebarCardStateReview() | ||
| // TR.cardStatsReviewLogTypeReview() | ||
| // TR.preferencesReview() | ||
| // TR.schedulingReview() |
There was a problem hiding this comment.
This seemed like the easiest way to handle the strings overlapping with TR values... if reviewers want, I can just use the TR values instead, but I'll need guidance on which to use for each of the three, since they don't seem related...
Alternatively, I could use IGNORED_BACKEND_TRANSLATIONS.
|
If you pull out 94a98c7, we can land it immediately |
Hm, I'll leave it here, it's not that big of a deal and I don't wanna have to shepherd another PR haha Changes:
Ready for review! |
|
I'm still a strong LGTM |
criticalAY
left a comment
There was a problem hiding this comment.
Not blocking on nits, looks good to me!! time to get this in
|
This one keeps failing out of the queue, seems like it needs a real look. I'm not going to point the review loop at it again until it gets one. Wanted this one in too! Hopefully it's not a huge issue |
More concise modern Kotlin syntax.
Migrations should be in a strict chain from V1 -> V2 -> ... -> ReviewReminder. Only the latest outdated schema should have its `migrate` method point at ReviewReminder. In particular, if someone creates a new migration later, they should remember to re-point the version (current - 2) at version (current - 1). To ensure this happens, unit tests are added. Assisted-by: Claude Opus 5.5
Previously, IDs were always regenerated upon migration, which theoretically could allow alarms attached to the old ID to still exist. They would die after one attempted firing and log an error, but this should not happen. Ensuring the ID is copied over upon migration is tricky because ReviewReminder's ID field is supposed to be secure and private, but I think this `createViaMigration` method works well enough. As an extra bonus, it allows some overly complicated test functions to be removed. However, it also breaks the hacky "mock" migration tests. Since we will soon (after the next migration) have enough migrations to fully exercise and demonstrate how the schema migration system works, I feel comfortable removing the old mocks. Any insight they provide has now been moved to docstrings. The mock review reminders in ReviewRemindersDatabaseTest have to be lazily created to ensure they obey the TimeManager freeze. This TimeManager freeze obviates the previous `latestNotifTime` volatility flag. Assisted-by: Claude Opus 5.5
`cachedDeckName` was not annotated with `@Transient`, which meant there was a possibility it could be persisted to SharedPreferences. I'm fairly sure current code paths make this impossible, but it really should be fixed. A problem then arises in that if a `cachedDeckName` was somehow persisted on a user's device, deserializing it will cause an error. Hence, this requires a migration. Because the migration involves a private member field of a data class, we need to modify the migration test helper to accommodate setting `cachedDeckName`. I think this new test helper is more extensible and powerful. Assisted-by: Claude Opus 5.5
Schema migration for the review reminders threshold filters feature.
UI for editing review reminder threshold filters.
Implements the reading of threshold filters are notification sending time. Adds unit tests.
|
@mikehardy its fixed lets get this in? |
|
Running a strings sync. Let's go! |
|
No strings sync needed! Reverted the only vandalism. Let's go! |
|
Maintainers: Please Sync Translations to produce a commit with only the automated changes from this PR. Read more about updating strings on the wiki, |
|
GREAT JOB!!!!!! |
|
Sorry, I've been busy for a few days, haven't had time to look at AnkiDroid. Thanks @criticalAY for handling the rebase!! Yippee |
Note
Assisted-by: Claude Opus 5.5
Purpose / Description
Add a group of new advanced review reminder options: count new cards, count cards in learning, and count cards in review. When the review reminder is about to send a notification and checks to see if the amount of cards in the deck is greater than the card trigger threshold, it examines these options to check if it should count and consider new cards, cards in learning, and cards in review.
Adds three new checkboxes to the AddEditReminderDialog to toggle these booleans on or off. Edits some logic in NotificationService to add up cards only from selected card type when determining whether the card trigger threshold is met.
Adds three new boolean fields to store the states of these settings to ReviewReminder. Adds unit tests. Deletes some old useless unit tests.
Fixes some review reminder migration bugs (no unit tests for checking versioning pointers, not retaining review reminder ID upon migration, accidentally persisting scope
cachedDeckName). Uses explicit backing fields in AddEditReminderDialogViewModel.UI
Fixes
How Has This Been Tested?
Checklist