Fix compile errors in feature:tweaks:presentation post-merge#565
Conversation
Three failures showed up after the skip-version + downgrade + text-overflow PRs all landed: 1. SkippedUpdatesState/SkippedUpdatesViewModel imported kotlinx.collections.immutable.ImmutableList / persistentListOf / toImmutableList, but the module's build.gradle.kts didn't declare the dependency. Added libs.kotlinx.collections.immutable to commonMain. 2. SkippedUpdatesRoot used stringResource(Res.string.navigate_back) without an explicit import — kotlin-resources requires each string to be individually imported. Added the import. 3. TweaksViewModel.onAction() was missing the OnSkippedUpdatesClick branch, which the navigation screen handles in the composable. The exhaustive-when warning was promoted to an error. Added a no-op branch with a comment explaining the navigation lives in the UI. ./gradlew compileDebugKotlinAndroid now passes clean from main.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR adds navigation support for a skipped-updates screen within the Tweaks feature. The changes introduce a new action handler in the ViewModel, add a dependency on immutable collections, and prepare resource imports for navigation UI elements. ChangesSkipped Updates Navigation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Why
After #559 (skip-version polish), #561 (downgrade detection), and #564 (text overflow) all landed on main, `./gradlew compileDebugKotlinAndroid` from `main` failed with three errors in `:feature:tweaks:presentation`. CI didn't catch this because each individual PR compiled fine in isolation — the regression only surfaced once all three were merged together.
Errors fixed
SkippedUpdatesState.kt/SkippedUpdatesViewModel.kt— importedkotlinx.collections.immutable.ImmutableList,persistentListOf, andtoImmutableList, but the module'sbuild.gradle.ktshad no dependency onkotlinx-collections-immutable. Eight unresolved-reference errors.implementation(libs.kotlinx.collections.immutable)tofeature/tweaks/presentation/build.gradle.ktscommonMain(the alias already exists ingradle/libs.versions.toml).SkippedUpdatesRoot.kt:96—stringResource(Res.string.navigate_back)referenced without an explicit per-string import. compose-resources requires every string to be individually imported alongside theResreference.import zed.rainxch.githubstore.core.presentation.res.navigate_back.TweaksViewModel.onAction()—when (action)missing theOnSkippedUpdatesClickbranch. The composable handles the navigation, so the ViewModel branch is a no-op, but the compiler-promoted exhaustiveness check still requires it.TweaksAction.OnSkippedUpdatesClick -> { /* handled in composable */ }branch.Verify
Only pre-existing warnings remain (
Unnecessary safe callinDetailsViewModel.ktlines 510 + 1469) — unrelated.Summary by CodeRabbit