Skip to content

Refactored code, updated dependencies, and removed deprecated usage#396

Merged
rainxchzed merged 2 commits intoOpenHub-Store:mainfrom
RudraYBedekar:feature/code-cleanup
Apr 8, 2026
Merged

Refactored code, updated dependencies, and removed deprecated usage#396
rainxchzed merged 2 commits intoOpenHub-Store:mainfrom
RudraYBedekar:feature/code-cleanup

Conversation

@RudraYBedekar
Copy link
Copy Markdown
Contributor

@RudraYBedekar RudraYBedekar commented Apr 7, 2026

This PR refactors the codebase by removing redundant conditions and unnecessary null checks, updates dependencies to the modern Compose version catalog, and eliminates deprecated APIs and configurations. These changes improve overall code quality, maintainability, and align the project with current Kotlin and Compose best practices. The project builds successfully and runs without issues after these updates.

Summary by CodeRabbit

  • Documentation

    • README formatting and wording corrected for clearer markup and copy
  • Refactor

    • Sort icon switched to auto-mirrored variant for visual consistency
    • Consolidated Compose resources to a centralized version catalog and removed an obsolete compiler option
    • Minor logic simplifications and small stability/compatibility tweaks across UI components

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 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: f5a390c5-b235-48d4-a5f9-fbc56103b40a

📥 Commits

Reviewing files that changed from the base of the PR and between 4b6dcb1 and 7ca103e.

📒 Files selected for processing (1)
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt

Walkthrough

Migrates Compose components resources to a version-catalog entry, updates several build files and imports, removes an experimental Kotlin compiler opt-in, simplifies minor UI/control-flow logic, adjusts one icon and an Instant type import, adds a deprecation suppression, and fixes README markup/wording.

Changes

Cohort / File(s) Summary
Version catalog & build root
gradle/libs.versions.toml, composeApp/build.gradle.kts
Added jetbrains-compose-components-resources catalog entry and migrated compose dependency coordinates in composeApp; removed explicit Compose Desktop target platform deps.
Feature & module build dependencies
core/presentation/build.gradle.kts, feature/.../presentation/build.gradle.kts (multiple modules listed below)
feature/apps/presentation/build.gradle.kts, feature/auth/presentation/build.gradle.kts, feature/details/presentation/build.gradle.kts, feature/dev-profile/presentation/build.gradle.kts, feature/favourites/presentation/build.gradle.kts, feature/home/presentation/build.gradle.kts, feature/profile/presentation/build.gradle.kts, feature/recently-viewed/presentation/build.gradle.kts, feature/search/presentation/build.gradle.kts, feature/starred/presentation/build.gradle.kts, feature/tweaks/presentation/build.gradle.kts
Replaced compose.components.resources references with version-catalog-backed libs.jetbrains.compose.components.resources across modules.
Kotlin compiler flags
build-logic/convention/src/main/kotlin/zed/rainxch/githubstore/convention/KotlinAndroid.kt
Removed free-compiler argument that opted into kotlinx.coroutines.ExperimentalCoroutinesApi.
UI component logic
feature/details/presentation/src/commonMain/.../AppHeader.kt, feature/details/presentation/src/commonMain/.../SmartInstallButton.kt
Removed no-op else branch from download-stage when; simplified isSameVersionInstalled boolean by dropping redundant null check.
Control-flow change in tweaks
feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/TweaksViewModel.kt
Removed an early else -> return in proxy-type handling, allowing implicit when handling to proceed.
Icon and Instant import
feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt
Switched to Icons.AutoMirrored.Filled.Sort; replaced kotlinx.datetime.Instant import with kotlin.time.Instant.
Deprecation suppression
core/presentation/src/jvmMain/kotlin/zed/rainxch/core/presentation/components/ScrollbarContainer.jvm.kt
Added @file:Suppress("DEPRECATION").
Documentation
README.md
Fixed HTML line break tags (</br><br/>), removed stray </p>, corrected wording (e.g., “a high school student”, “GitHub Store”, license tense).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped through catalogs, tidy and light,
Replaced some tags, made builds feel right,
Trimmed a branch, swapped a date’s hue,
Mirrored an icon and whispered "phew" —
Compose dreams grow in versioned rows.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: code refactoring, dependency updates, and removal of deprecated usage across the entire changeset.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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: 1

🧹 Nitpick comments (1)
core/presentation/src/jvmMain/kotlin/zed/rainxch/core/presentation/components/ScrollbarContainer.jvm.kt (1)

1-1: Narrow @file:Suppress("DEPRECATION") to specific function scopes.

The file-level suppression hides all deprecation warnings in the file. Since the deprecated APIs (LocalScrollbarStyle, VerticalScrollbar, rememberScrollbarAdapter, ScrollbarAdapter) are used only within the two ScrollbarContainer functions and the StaggeredGridScrollbarAdapter class, move the suppression to those declarations to avoid masking unrelated future deprecations.

Suggested refactor
-@file:Suppress("DEPRECATION")
 
 package zed.rainxch.core.presentation.components
 
@@ -19,6 +19,7 @@ import androidx.compose.ui.unit.dp
 
+@Suppress("DEPRECATION")
 `@Composable`
 actual fun ScrollbarContainer(
     listState: LazyListState,
@@ -52,6 +53,7 @@ actual fun ScrollbarContainer(
 }
 
+@Suppress("DEPRECATION")
 `@Composable`
 actual fun ScrollbarContainer(
     gridState: LazyStaggeredGridState,
@@ -89,6 +91,7 @@ actual fun ScrollbarContainer(
  * Custom [ScrollbarAdapter] for [LazyStaggeredGridState] since Compose Desktop
  * does not provide a built-in [rememberScrollbarAdapter] overload for staggered grids.
  */
+@Suppress("DEPRECATION")
 private class StaggeredGridScrollbarAdapter(
     private val gridState: LazyStaggeredGridState,
 ) : ScrollbarAdapter {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@core/presentation/src/jvmMain/kotlin/zed/rainxch/core/presentation/components/ScrollbarContainer.jvm.kt`
at line 1, The file-level suppression should be narrowed: remove
`@file`:Suppress("DEPRECATION") and instead add `@Suppress`("DEPRECATION") directly
on the two ScrollbarContainer function declarations and on the
StaggeredGridScrollbarAdapter class where LocalScrollbarStyle,
VerticalScrollbar, rememberScrollbarAdapter and ScrollbarAdapter are used, so
only those scopes silence deprecation warnings and unrelated future deprecations
remain visible.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt`:
- Line 25: Add the file-level opt-in for Kotlin experimental time APIs: insert
`@file`:OptIn(ExperimentalTime::class) at the very top of AppsRoot.kt and add an
import for kotlin.time.ExperimentalTime so usages of kotlin.time.Instant (used
around the logic that references Instant at lines where Instant is used) compile
without warnings; follow the same pattern as HomeRepositoryImpl.kt and
StarredReposRoot.kt by opting into ExperimentalTime at file level.

---

Nitpick comments:
In
`@core/presentation/src/jvmMain/kotlin/zed/rainxch/core/presentation/components/ScrollbarContainer.jvm.kt`:
- Line 1: The file-level suppression should be narrowed: remove
`@file`:Suppress("DEPRECATION") and instead add `@Suppress`("DEPRECATION") directly
on the two ScrollbarContainer function declarations and on the
StaggeredGridScrollbarAdapter class where LocalScrollbarStyle,
VerticalScrollbar, rememberScrollbarAdapter and ScrollbarAdapter are used, so
only those scopes silence deprecation warnings and unrelated future deprecations
remain visible.
🪄 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: 913da90e-201a-4f54-8a0c-390d904af7f8

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8a833 and 4b6dcb1.

📒 Files selected for processing (21)
  • README.md
  • build-logic/convention/src/main/kotlin/zed/rainxch/githubstore/convention/KotlinAndroid.kt
  • composeApp/build.gradle.kts
  • core/presentation/build.gradle.kts
  • core/presentation/src/jvmMain/kotlin/zed/rainxch/core/presentation/components/ScrollbarContainer.jvm.kt
  • feature/apps/presentation/build.gradle.kts
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt
  • feature/auth/presentation/build.gradle.kts
  • feature/details/presentation/build.gradle.kts
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/AppHeader.kt
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/SmartInstallButton.kt
  • feature/dev-profile/presentation/build.gradle.kts
  • feature/favourites/presentation/build.gradle.kts
  • feature/home/presentation/build.gradle.kts
  • feature/profile/presentation/build.gradle.kts
  • feature/recently-viewed/presentation/build.gradle.kts
  • feature/search/presentation/build.gradle.kts
  • feature/starred/presentation/build.gradle.kts
  • feature/tweaks/presentation/build.gradle.kts
  • feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/TweaksViewModel.kt
  • gradle/libs.versions.toml
💤 Files with no reviewable changes (4)
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/AppHeader.kt
  • build-logic/convention/src/main/kotlin/zed/rainxch/githubstore/convention/KotlinAndroid.kt
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/SmartInstallButton.kt
  • feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/TweaksViewModel.kt

@RudraYBedekar
Copy link
Copy Markdown
Contributor Author

Addressed the review feedback by adding the required ExperimentalTime opt-in. All checks are passing and the application runs successfully.

@rainxchzed
Copy link
Copy Markdown
Member

@RudraYBedekar Changes look all good, thank you for your contribution, lets get it merged 🩵

@rainxchzed rainxchzed merged commit 7e31007 into OpenHub-Store:main Apr 8, 2026
1 check passed
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