Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Comments

📝 fixed complex impls#246

Merged
shub39 merged 1 commit intomasterfrom
dev
Feb 21, 2026
Merged

📝 fixed complex impls#246
shub39 merged 1 commit intomasterfrom
dev

Conversation

@shub39
Copy link
Owner

@shub39 shub39 commented Feb 21, 2026

Summary by CodeRabbit

Release Notes

  • Removed Features

    • Removed server settings page from the application.
  • Documentation

    • Updated contribution guidelines with streamlined workflow steps and build requirements.
  • Bug Fixes

    • Refined exception handling for backup restore operations to better detect schema mismatches.

@shub39 shub39 merged commit 44440e0 into master Feb 21, 2026
2 of 3 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Feb 21, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

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.

Changes

Cohort / File(s) Summary
Datastore Architecture Refactoring
app/src/main/java/com/shub39/grit/core/domain/SettingsDatastore.kt, app/src/main/java/com/shub39/grit/core/domain/ThemeDatastore.kt, app/src/main/java/com/shub39/grit/core/data/SettingsDatastoreImpl.kt, app/src/main/java/com/shub39/grit/core/data/ThemeDatastoreImpl.kt
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.
ViewModel Datastore Dependencies
app/src/main/java/com/shub39/grit/viewmodels/MainViewModel.kt, app/src/main/java/com/shub39/grit/viewmodels/SettingsViewModel.kt, app/src/main/java/com/shub39/grit/viewmodels/HabitViewModel.kt, app/src/main/java/com/shub39/grit/viewmodels/TasksViewModel.kt, app/src/main/java/com/shub39/grit/habits/data/repository/HabitRepository.kt
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.
Intent Receiver Refactoring
app/src/main/java/com/shub39/grit/core/data/GritIntentReceiver.kt
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.
Widget Package Restructuring
app/src/main/java/com/shub39/grit/widgets/alltaskswidget/*, app/src/main/java/com/shub39/grit/widgets/habitoverviewwidget/*, app/src/main/java/com/shub39/grit/widgets/habitstreakwidget/*, app/src/main/java/com/shub39/grit/widgets/habitweekchartwidget/*, app/src/main/AndroidManifest.xml, app/src/main/java/com/shub39/grit/app/GritApplication.kt
Renames widget package paths from hyphenated to concatenated formats: habit_overview_widgethabitoverviewwidget, all_tasks_widgetalltaskswidget, habit_streak_widgethabitstreakwidget, habit_weekchart_widgethabitweekchartwidget. Updates manifest receiver entries and GritApplication imports accordingly.
Settings UI Removal
app/src/main/java/com/shub39/grit/core/presentation/settings/ui/section/ServerPage.kt, app/src/main/java/com/shub39/grit/core/presentation/settings/SettingsAction.kt
Removes entire ServerPage.kt file (284 lines) containing server status UI, control, permission handling, and preview. Removes OnResetTheme action from SettingsAction sealed interface.
Build Configuration & Error Handling
build.gradle.kts, detekt.yml, app/src/main/java/com/shub39/grit/core/data/BootReceiver.kt, app/src/main/java/com/shub39/grit/core/data/backup/restore/RestoreImpl.kt, app/src/main/java/com/shub39/grit/core/domain/backup/RestoreRepo.kt
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.
Code Cleanup & Style
app/src/main/java/com/shub39/grit/core/presentation/settings/ui/component/listItemExt.kt, app/src/main/java/com/shub39/grit/core/presentation/util.kt, CONTRIBUTING.md
Renames private constants to uppercase convention (connectedCornerRadiusCONNECTED_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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant