Skip to content

Picking asset didn't work #382#422

Merged
rainxchzed merged 1 commit intomainfrom
issue-383-asset-picking
Apr 16, 2026
Merged

Picking asset didn't work #382#422
rainxchzed merged 1 commit intomainfrom
issue-383-asset-picking

Conversation

@Jassem-sendi
Copy link
Copy Markdown
Collaborator

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

Summary by CodeRabbit

  • Refactor
    • Improved asset selection and linking logic with multiple fallback strategies to ensure better preservation of user preferences when linking apps to repositories and handling available updates
    • Strengthened asset matching reliability with more consistent handling across different update scenarios

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 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: 9633ef20-401d-4553-97a4-6fc3d7d6b136

📥 Commits

Reviewing files that changed from the base of the PR and between d66565a and a84c641.

📒 Files selected for processing (2)
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsViewModel.kt
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.kt

Walkthrough

Two ViewModels updated: AppsViewModel now precomputes linking inputs from UI state before repository calls; DetailsViewModel extends asset resolution with multi-strategy fallback chain using installed app metadata and position-based recovery.

Changes

Cohort / File(s) Summary
AppsViewModel Linking Inputs
feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsViewModel.kt
Refactored validateWithAsset to precompute linking inputs—siblingCount, pickedIndex, assetFilterRegex, fallbackToOlder—from UI state and pass them consistently to appsRepository.linkAppToRepo across both success and error branches.
DetailsViewModel Asset Resolution
feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.kt
Extended recomputeAssetsForRelease with optional InstalledApp override parameter and implemented three-tier asset selection strategy: preferred variant matching with pinned tokens/glob, fallback to same-position matching via pickedAssetIndex, and final fallback to primary asset. Updated update-availability asset selection to prefer primaryAsset before name-based matching.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 With linking inputs precomputed clean,
And assets resolved by strategy keen,
Position and tokens dance in the flow,
Fallback chains help selection to glow.
State-driven precision hops through the view! 🌟

🚥 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 directly addresses the main issue being fixed: asset picking functionality. The changes across both ViewModels focus on improving asset selection logic with computed variables and refined fallback strategies.

✏️ 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-383-asset-picking

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.

@rainxchzed rainxchzed merged commit ebfb06b into main Apr 16, 2026
1 check passed
@rainxchzed rainxchzed deleted the issue-383-asset-picking branch April 16, 2026 02:28
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