Skip to content

feat: implement per-app pre-release update settings#368

Merged
rainxchzed merged 2 commits intomainfrom
fix-unstable-update-bug
Mar 28, 2026
Merged

feat: implement per-app pre-release update settings#368
rainxchzed merged 2 commits intomainfrom
fix-unstable-update-bug

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

@rainxchzed rainxchzed commented Mar 28, 2026

  • Add includePreReleases column to
    installed_apps table in database version 8.
  • Implement database migration
    MIGRATION_7_8 to support the new schema change.
  • Update
    InstalledApp domain and UI models to include the pre-release preference.
  • Add a "Pre-releases" toggle switch to the app details UI in the apps list.
  • Implement
    OnTogglePreReleases action in
    AppsViewModel to update settings and trigger immediate update checks.
  • Refactor
    AppsRepository and
    InstalledAppsRepository to pass the
    includePreReleases flag when fetching the latest releases from GitHub.
  • Add localized strings for "Pre-releases" in Arabic, Turkish, Bengali, Hindi, Italian, Spanish, French, Polish, Russian, Japanese, Korean, and Chinese (Simplified).
  • Remove unnecessary
    TweaksRepository dependency from
    InstalledAppsRepositoryImpl and
    SharedModule.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added per-app pre-release toggles. Users can now enable or disable pre-release version inclusion for individual apps during update checks.
  • Chores

    • Updated database schema with migration support.
    • Expanded localization support for multiple languages.

- Add localized strings for `bottom_nav_profile_tweaks` and `tweaks_title`.
- Provide translations for Bengali, Hindi, Italian, Spanish, Arabic, French, Polish, Russian, Japanese, Korean, Turkish, and Chinese (Simplified).
- Add `includePreReleases` column to `installed_apps` table in database version 8.
- Implement database migration `MIGRATION_7_8` to support the new schema change.
- Update `InstalledApp` domain and UI models to include the pre-release preference.
- Add a "Pre-releases" toggle switch to the app details UI in the apps list.
- Implement `OnTogglePreReleases` action in `AppsViewModel` to update settings and trigger immediate update checks.
- Refactor `AppsRepository` and `InstalledAppsRepository` to pass the `includePreReleases` flag when fetching the latest releases from GitHub.
- Add localized strings for "Pre-releases" in Arabic, Turkish, Bengali, Hindi, Italian, Spanish, French, Polish, Russian, Japanese, Korean, and Chinese (Simplified).
- Remove unnecessary `TweaksRepository` dependency from `InstalledAppsRepositoryImpl` and `SharedModule`.
@rainxchzed rainxchzed merged commit fe68d44 into main Mar 28, 2026
@rainxchzed rainxchzed deleted the fix-unstable-update-bug branch March 28, 2026 11:59
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 28, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 872bdf41-fc68-4adb-b638-297c453dfc51

📥 Commits

Reviewing files that changed from the base of the PR and between c567237 and 3163f60.

📒 Files selected for processing (33)
  • composeApp/release/baselineProfiles/0/composeApp-release.dm
  • composeApp/release/baselineProfiles/1/composeApp-release.dm
  • core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/8.json
  • core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/initDatabase.kt
  • core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/migrations/MIGRATION_7_8.kt
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/di/SharedModule.kt
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/AppDatabase.kt
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/dao/InstalledAppDao.kt
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/entities/InstalledAppEntity.kt
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/mappers/InstalledAppsMappers.kt
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/InstalledAppsRepositoryImpl.kt
  • core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/model/InstalledApp.kt
  • core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/repository/InstalledAppsRepository.kt
  • core/presentation/src/commonMain/composeResources/values-ar/strings-ar.xml
  • core/presentation/src/commonMain/composeResources/values-bn/strings-bn.xml
  • core/presentation/src/commonMain/composeResources/values-es/strings-es.xml
  • core/presentation/src/commonMain/composeResources/values-fr/strings-fr.xml
  • core/presentation/src/commonMain/composeResources/values-hi/strings-hi.xml
  • core/presentation/src/commonMain/composeResources/values-it/strings-it.xml
  • core/presentation/src/commonMain/composeResources/values-ja/strings-ja.xml
  • core/presentation/src/commonMain/composeResources/values-ko/strings-ko.xml
  • core/presentation/src/commonMain/composeResources/values-pl/strings-pl.xml
  • core/presentation/src/commonMain/composeResources/values-ru/strings-ru.xml
  • core/presentation/src/commonMain/composeResources/values-tr/strings-tr.xml
  • core/presentation/src/commonMain/composeResources/values-zh-rCN/strings-zh-rCN.xml
  • core/presentation/src/commonMain/composeResources/values/strings.xml
  • feature/apps/data/src/commonMain/kotlin/zed/rainxch/apps/data/repository/AppsRepositoryImpl.kt
  • feature/apps/domain/src/commonMain/kotlin/zed/rainxch/apps/domain/repository/AppsRepository.kt
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsAction.kt
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsViewModel.kt
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/mappers/InstalledAppMapper.kt
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/model/InstalledAppUi.kt

Walkthrough

This PR adds per-app pre-release inclusion toggle functionality, progressing the database schema from version 7 to 8 with a migration that adds an includePreReleases column to installed_apps. The feature includes data layer updates (entity, DAO, mappers), repository refactoring that removes TweaksRepository dependency, domain model extension, presentation layer UI toggle, and localized string resources across 12 languages.

Changes

Cohort / File(s) Summary
Database Schema & Migration
core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/8.json, core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/migrations/MIGRATION_7_8.kt, core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/AppDatabase.kt
Database version bumped from 7 to 8; migration adds non-null includePreReleases integer column (default 0) to installed_apps table; schema file defines version 8 structure with 7 tables.
Core Data Layer – Entities, DAO, Mappers
core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/entities/InstalledAppEntity.kt, core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/dao/InstalledAppDao.kt, core/data/src/commonMain/kotlin/zed/rainxch/core/data/mappers/InstalledAppsMappers.kt
Entity and DAO updated to include includePreReleases field; new DAO method updateIncludePreReleases(packageName, enabled) for targeted updates; mappers thread field through entity↔domain conversions.
Core Data Repository & Wiring
core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/InstalledAppsRepositoryImpl.kt, core/data/src/commonMain/kotlin/zed/rainxch/core/data/di/SharedModule.kt
InstalledAppsRepositoryImpl removes TweaksRepository dependency; new setIncludePreReleases(packageName, enabled) method; fetchLatestPublishedRelease now accepts includePreReleases parameter; checkForUpdates passes app.includePreReleases to release resolution.
Core & Apps Domain Layer
core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/model/InstalledApp.kt, core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/repository/InstalledAppsRepository.kt, feature/apps/domain/src/commonMain/kotlin/zed/rainxch/apps/domain/repository/AppsRepository.kt
InstalledApp data class adds includePreReleases: Boolean = false field; InstalledAppsRepository adds setIncludePreReleases(packageName, enabled) method; AppsRepository.getLatestRelease(...) signature extended with optional includePreReleases parameter.
Apps Feature – Data Repository
feature/apps/data/src/commonMain/kotlin/zed/rainxch/apps/data/repository/AppsRepositoryImpl.kt
getLatestRelease updated to accept includePreReleases parameter; linkAppToRepo fetches global pre-release flag and sets it on new InstalledApp instance.
Apps Feature – Presentation (Actions, UI, ViewModel, Mappers)
feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsAction.kt, feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt, feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsViewModel.kt, feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/mappers/InstalledAppMapper.kt, feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/model/InstalledAppUi.kt
New OnTogglePreReleases action variant; AppItemCard adds Switch UI for pre-release toggle with onTogglePreReleases callback; AppsViewModel handles toggle action and refetches release data; InstalledAppUi model and mappers extended with includePreReleases field.
Localization Resources
core/presentation/src/commonMain/composeResources/values*/strings-*.xml (ar, bn, es, fr, hi, it, ja, ko, pl, ru, tr, zh-rCN), core/presentation/src/commonMain/composeResources/values/strings.xml
Added three new string resources per language file: bottom_nav_profile_tweaks, tweaks_title, and pre_releases; base English file adds pre_releases label; all changes are resource additions with no existing keys modified.

Sequence Diagram

sequenceDiagram
    actor User
    participant UI as AppsScreen/AppItemCard
    participant VM as AppsViewModel
    participant AppRepo as AppsRepository
    participant InstallRepo as InstalledAppsRepository
    participant Database as AppDatabase

    User->>UI: Toggle Pre-releases Switch
    UI->>VM: OnTogglePreReleases(packageName, enabled)
    VM->>InstallRepo: setIncludePreReleases(packageName, enabled)
    InstallRepo->>Database: updateIncludePreReleases(packageName, enabled)
    Database-->>InstallRepo: Success
    VM->>InstallRepo: checkForUpdates(packageName)
    InstallRepo->>AppRepo: getLatestRelease(owner, repo, includePreReleases=true)
    AppRepo-->>InstallRepo: GithubRelease
    InstallRepo-->>VM: Release fetched
    VM->>UI: Update app state with new release
    UI-->>User: Display updated release info
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A toggle springs to life so fine,
Pre-releases now shine by design,
Per-app control, at last it's here,
Each package picks what updates appear,
A hoppy hop through version cheer! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-unstable-update-bug

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