Skip to content

fix(variant): strip pre-release qualifier from pinned label (#612)#613

Merged
rainxchzed merged 1 commit into
mainfrom
fix/612-pinned-variant-display-drift
May 16, 2026
Merged

fix(variant): strip pre-release qualifier from pinned label (#612)#613
rainxchzed merged 1 commit into
mainfrom
fix/612-pinned-variant-display-drift

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

@rainxchzed rainxchzed commented May 16, 2026

Closes #612. Pinned-variant chip on Details showed stale beta.NN-arm64-v8a from older release.

Root cause: AssetVariant.extract() anchors on first dotted-digit segment. For legado-3.26.11-beta.24-arm64-v8a.apk it returns beta.24-arm64-v8a. beta.24 is a qualifier counter, not variant identity — drifts to beta.29 next release but stored label persists.

Fix:

  • AssetVariant.extract() strips leading pre-release qualifier prefixes after the version split (beta.NN, rc.NN, alpha.NN, dev.NN, nightly.NN, m12, etc.). Token-set + glob matchers untouched — they already handled it correctly.
  • Header.kt re-derives display label from currently matched primaryAsset.name via extract(), so existing pinned rows refresh without DB migration.

Test plan

  • Android compile clean
  • Device: pin a beta-channel app on beta.NN, install beta.NN+1, chip shows arm64-v8a (no qualifier counter).

Summary by CodeRabbit

  • Bug Fixes
    • The variant label displayed in the Details screen now properly refreshes with each app version, preventing older beta and release candidate version numbers from remaining in the interface
    • Improved detection and visibility of Magisk/KernelSU/APatch installations on Android 13+ devices, resolving previous issues where system-level restrictions prevented accurate detection display

Review Change Stack

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

rainxchzed has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 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: 97f22d56-ee75-4109-98c6-b63d2ca8c710

📥 Commits

Reviewing files that changed from the base of the PR and between a98ac82 and e6587ae.

📒 Files selected for processing (15)
  • core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/util/AssetVariant.kt
  • core/presentation/src/commonMain/composeResources/files/whatsnew/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ar/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/bn/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/es/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/fr/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/hi/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/it/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ja/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ko/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/pl/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ru/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/tr/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/zh-CN/18.json
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/sections/Header.kt

Walkthrough

This PR fixes incorrect variant text display on repository details screens. It updates AssetVariant.extract() to recursively strip pre-release qualifier prefixes (beta, rc, etc.) from variant identifiers and wires the Details header to dynamically refresh pinned-variant labels from the currently matched asset instead of cached preferences. Release notes across 14 locales document these fixes.

Changes

Variant Label Refresh and Pre-release Cleanup

Layer / File(s) Summary
Pre-release qualifier stripping in AssetVariant
core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/util/AssetVariant.kt
AssetVariant.extract() now uses a PRE_RELEASE_PREFIX regex to repeatedly remove leading pre-release qualifier tokens (beta/rc/alpha/dev/etc.) and their digit counters from variant identifiers, instead of returning the extracted tail immediately.
Pinned variant label refresh in Header
feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/sections/Header.kt
Header now computes pinnedVariantLabel by extracting a qualifier from the currently matched installed asset name using the updated AssetVariant.extract(), with fallback to the stored preferredAssetVariant when extraction is blank. This replaces the prior behavior of always using the stored preference, ensuring the pinned-variant label refreshes dynamically.
Localized release notes
core/presentation/src/commonMain/composeResources/files/whatsnew/{18,ar/18,bn/18,es/18,fr/18,hi/18,it/18,ja/18,ko/18,pl/18,ru/18,tr/18,zh-CN/18}.json
Release notes for version 1.8.3 across 14 languages document that the pinned-variant label in Details now refreshes across releases, preventing old beta/rc numbers from persisting in the chip.

🐰 A variant label, once pinned, now sheds its old qualifiers—
beta and rc numbers fade away like morning dew,
refreshing fresh with every release anew,
no stale beta badges to confuse you! ✨

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • OpenHub-Store/GitHub-Store#408: Introduced the foundational AssetVariant.extract(...) logic that this PR refines by adding recursive pre-release qualifier stripping.
  • OpenHub-Store/GitHub-Store#411: Implemented multi-layer variant fingerprinting that relies on the AssetVariant extraction behavior being updated in this PR.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(variant): strip pre-release qualifier from pinned label' directly describes the main code change in AssetVariant.extract() and Header.kt, accurately summarizing the primary fix.
Linked Issues check ✅ Passed The PR successfully addresses issue #612 by implementing code changes that strip pre-release qualifiers from variant display labels, preventing stale qualifier counters from appearing in the pinned-variant chip.
Out of Scope Changes check ✅ Passed All changes are in-scope: the core fix in AssetVariant.kt and Header.kt directly address #612, while localized release notes across 14 JSON files document the fix appropriately for users without introducing unrelated functionality.

✏️ 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 fix/612-pinned-variant-display-drift

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 01226dc into main May 16, 2026
1 check passed
@rainxchzed rainxchzed deleted the fix/612-pinned-variant-display-drift branch May 16, 2026 15:13
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.

display wrong variants text

1 participant