You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR refactors datastore architecture by splitting GritDatastore into SettingsDatastore and a new ThemeDatastore, renames widget package paths from hyphenated to concatenated formats, removes the server settings UI and Detekt configuration, refactors GritIntentReceiver with helper functions, and updates multiple ViewModels to use the split datastores.
Splits single GritDatastore into two: SettingsDatastore (notifications, biometric lock, start of week) and new ThemeDatastore (app theme, colors, fonts, Material You, amoled). SettingsDatastoreImpl renamed from DataStoreImpl, implements SettingsDatastore; new ThemeDatastoreImpl implements ThemeDatastore.
Updated constructors to inject split datastores: SettingsViewModel now uses both ThemeDatastore and SettingsDatastore; others replace GritDatastore with SettingsDatastore. Routes state observation and mutations through appropriate datastore.
Replaces direct intent handling in onReceive with new private suspend helper functions (habitNotification, addHabitStatus, taskNotification, markTaskDone). Switches from GritDatastore to SettingsDatastore for pause/notification settings. Updates how IntentActions are processed with dedicated methods.
Removes Detekt plugin and entire configuration file. Narrows BootReceiver exception handling from Throwable to Exception. Introduces SchemaMismatchException in restore flow, replaces IllegalArgumentException with targeted exception handling and logging.
Renames private constants to uppercase convention (connectedCornerRadius → CONNECTED_CORNER_RADIUS). Refactors random line selection to use private list. Updates contribution guidelines with spotless requirement and workflow reordering.
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
🔧 Tweaks #111: Modifies HabitRepository implementation alongside this PR's change to its injected datastore type.
Widgets overhaul and changelog #236: Refactors widget package naming and manifest entries that directly overlap with this PR's widget restructuring changes.
✨ revenuecat #115: Both refactor the datastore/viewmodel surfaces (SettingsDatastore, ThemeDatastore, SettingsViewModel, SettingsAction) and coordinate theme/settings API changes.
Poem
🐰 Hop, hop—the datastores now split in two! Themes dance with one, settings with the new. Widgets march together, packages neat, A spring cleanup makes the refactor sweet! 🌱
✨ Finishing Touches
📝 Generate docstrings (stacked PR)
📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
Create PR with unit tests
Post copyable unit tests in a comment
Commit unit tests in branch dev
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
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
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.
Summary by CodeRabbit
Release Notes
Removed Features
Documentation
Bug Fixes