Skip to content

issue-380-ui-improvement#386

Merged
rainxchzed merged 5 commits intomainfrom
issue-380-ui-improvement
Apr 2, 2026
Merged

issue-380-ui-improvement#386
rainxchzed merged 5 commits intomainfrom
issue-380-ui-improvement

Conversation

@Jassem-sendi
Copy link
Copy Markdown
Collaborator

@Jassem-sendi Jassem-sendi commented Apr 2, 2026

Summary by CodeRabbit

  • New Features

    • Added app sorting (Updates first, Recently updated, Name)
    • Show latest release dates in version info
    • Display system app icons for installed apps
    • Owner avatars shown inline with repo info
    • Added sort UI and controls in Apps screen
  • Bug Fixes

    • Fixed phrasing in logout confirmation and install-permission messages
  • Chores

    • Database schema bumped to version 9 (migration included)

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8a20c949-00d4-40b9-b096-d1a60f293c80

📥 Commits

Reviewing files that changed from the base of the PR and between 5130d85 and 261d119.

📒 Files selected for processing (3)
  • core/presentation/src/commonMain/composeResources/values/strings.xml
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsViewModel.kt
🚧 Files skipped from review as they are similar to previous changes (2)
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsViewModel.kt

Walkthrough

Adds Room DB migration v8→v9 adding latestReleasePublishedAt, propagates the field through domain, data, mappers, DAO and repository persistence, introduces app sorting (UpdatesFirst / RecentlyUpdated / Name) in presentation, and provides multiplatform InstalledAppIcon implementations (Android/JVM).

Changes

Cohort / File(s) Summary
Database Schema & Migration
core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/9.json, core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/migrations/MIGRATION_8_9.kt, core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/initDatabase.kt, core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/AppDatabase.kt
Added Room schema v9 and identityHash; new migration MIGRATION_8_9 adds latestReleasePublishedAt column to installed_apps; migration registered in DB init; version bumped to 9.
Data & Domain Models
core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/entities/InstalledAppEntity.kt, core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/model/InstalledApp.kt, core/data/src/commonMain/kotlin/zed/rainxch/core/data/mappers/InstalledAppsMappers.kt, core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/dao/InstalledAppDao.kt, core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/InstalledAppsRepositoryImpl.kt
Added nullable latestReleasePublishedAt to entity and domain model; mappers updated both directions; DAO updateVersionInfo gains parameter and SQL to persist field; repository now writes latestReleasePublishedAt when checking updates.
Presentation Models & Sorting Logic
feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/model/AppSortRule.kt, feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/model/InstalledAppUi.kt, feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsAction.kt, feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsState.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
Added AppSortRule enum and sortRule state; action OnSortRuleSelected; view model uses appComparator(sortRule) to compute sorted lists for all queries; UI model and mappers include latestReleasePublishedAt.
UI Components & Icons
feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/components/InstalledAppIcon.kt, feature/apps/presentation/src/androidMain/kotlin/zed/rainxch/apps/presentation/components/InstalledAppIcon.android.kt, feature/apps/presentation/src/jvmMain/kotlin/zed/rainxch/apps/presentation/components/InstalledAppIcon.jvm.kt
Added multiplatform InstalledAppIcon expect + actuals: Android loads app icon via PackageManager with bitmap fallback to drawable; JVM uses drawable.
Main Screen & UI Updates
feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt, core/presentation/src/commonMain/composeResources/values/strings.xml
Top-bar sort menu added; AppsRoot UI updated to use InstalledAppIcon, added busy-state gating for controls, owner avatar inline, checkbox for pre-release, and formatted version label that can show parsed publication date; new sort string resources and minor text fixes.
Build / Dependency
feature/apps/presentation/build.gradle.kts
Added libs.kotlinx.datetime to commonMain for date/time parsing/formatting used by version label logic.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant UI as AppsScreen
  participant VM as AppsViewModel
  participant Repo as InstalledAppsRepository
  participant DB as AppDatabase
  participant PM as PackageManager

  User->>UI: open apps screen / select sort
  UI->>VM: dispatch AppsAction.OnSortRuleSelected
  VM->>VM: update state.sortRule, filterApps()
  VM->>Repo: request apps (sorted)
  Repo->>DB: query installed_apps (includes latestReleasePublishedAt)
  DB-->>Repo: rows with latestReleasePublishedAt
  Repo-->>VM: domain models (with latestReleasePublishedAt)
  VM-->>UI: ui models list (sorted using latestReleasePublishedAt / lastUpdatedAt / name)
  UI->>PM: (Android) resolve app icon by packageName for each item
  PM-->>UI: app icon bitmap or NameNotFound -> UI uses drawable fallback
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 wiggles whiskers
I hopped through rows and schema nine,
Tuned sorts and icons, neat design.
Dates now dance beside each name,
From PackageManager to UI frame —
A rabbit cheers: the app list sings! 🎉

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The pull request title 'issue-380-ui-improvement' is vague and generic, using non-descriptive terms that don't convey the specific changes made in the changeset. Replace with a more descriptive title that summarizes the main changes, such as 'Add app sorting and release date display' or 'Add sort functionality and display latest release dates'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 issue-380-ui-improvement

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@core/presentation/src/commonMain/composeResources/values/strings.xml`:
- Line 264: The string resource install_permission_blocked_message contains a
malformed apostrophe ("doesn't\'t") that will render as "doesn't't"; update the
value for install_permission_blocked_message to use a single correct apostrophe
or proper XML escaping (e.g., "doesn't" or ') so the message reads: "The
APK was downloaded successfully but this device doesn't allow direct
installation. Would you like to open it with an external installer?".

In
`@feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt`:
- Around line 911-939: The code currently uses
latestReleasePublishedAt?.take(10) which returns the UTC day substring and falls
back to lastUpdatedAt; instead parse latestReleasePublishedAt through the same
local-time path and only show a date when a parsed local date exists and
latestReleasePublishedAt is non-null. Update buildVersionLabel to stop using
take(10) and call a new helper (or overload formatEpochDate) that converts an
ISO timestamp String -> Instant ->
toLocalDateTime(TimeZone.currentSystemDefault()).date.toString(), and keep the
existing formatEpochDate(Long) for lastUpdatedAt but do NOT use lastUpdatedAt as
a fallback for the release date; if latestReleasePublishedAt is null or fails to
parse, hide the date.

In
`@feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsViewModel.kt`:
- Around line 363-379: The comparator always prefixes updatesFirst (defined in
appComparator) so AppSortRule.Name and AppSortRule.RecentlyUpdated never become
the primary sort; change appComparator to apply updatesFirst only for the
AppSortRule.UpdatesFirst branch and for AppSortRule.RecentlyUpdated and
AppSortRule.Name return comparators that start with their intended primary key
(e.g., lastUpdatedAt or appName.lowercase()) and only optionally call thenBy/on
updatesFirst if you truly want updateable apps secondary; update the when
branches for AppSortRule.RecentlyUpdated and AppSortRule.Name to not reuse the
updatesFirst comparator as the head.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 53ff5145-2e5d-46a7-82f3-7db9ec687d43

📥 Commits

Reviewing files that changed from the base of the PR and between 49dabfb and 5130d85.

📒 Files selected for processing (23)
  • .gradle-local/wrapper/dists/gradle-8.14.3-bin/cv11ve7ro1n3o1j4so8xd9n66/gradle-8.14.3-bin.zip.lck
  • .gradle-local/wrapper/dists/gradle-8.14.3-bin/cv11ve7ro1n3o1j4so8xd9n66/gradle-8.14.3-bin.zip.part
  • core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/9.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_8_9.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/presentation/src/commonMain/composeResources/values/strings.xml
  • feature/apps/presentation/build.gradle.kts
  • feature/apps/presentation/src/androidMain/kotlin/zed/rainxch/apps/presentation/components/InstalledAppIcon.android.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/AppsState.kt
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsViewModel.kt
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/components/InstalledAppIcon.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/AppSortRule.kt
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/model/InstalledAppUi.kt
  • feature/apps/presentation/src/jvmMain/kotlin/zed/rainxch/apps/presentation/components/InstalledAppIcon.jvm.kt

@rainxchzed rainxchzed merged commit ce9e1bc into main Apr 2, 2026
1 check passed
@rainxchzed rainxchzed deleted the issue-380-ui-improvement branch April 2, 2026 15:26
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.

2 participants