You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reviewed the full diff (both commits), the two call sites, and compiled :app:compileStableDebugKotlin successfully.
Summary
Refactors ArcaeaRatingClassSelector to take a single items: List<RatingClassSelectorItem> instead of separate enabledRatingClasses + ratingDetails, adds a shared List<Chart>.toRatingClassSelectorItems() mapping, and introduces ArcaeaRatingClassDisplay (+ an INSCRIBED color alias) as groundwork for #61. Color math moves from HSL (androidx.core.graphics.ColorUtils) to HCT (materialkolor).
What's good
Much cleaner public API; both callers (ArcaeaChartSelector, UtilitiesCalculatorScreen) dedupe the same derivation logic into one mapper.
RatingClassSelectorItem is @Immutable, the box colors are now computed once in init instead of on every property access, and colors are cached via remember(baseColor).
modifier is now properly forwarded into the layout.
Issues / concerns
INSCRIBED silently collapses with BEYOND — ArcaeaRatingClassSelector.kt:314 matches items to slots by it.display.ratingClass == slotRatingClass. Since INSCRIBED reuses BEYOND as its rating class, an Inscribed item renders in the Beyond slot; if a real Beyond and an Inscribed item were ever both present, find keeps only the first and the other disappears with no warning. Worth a uniqueness guarantee/assert or an explicit KDoc, since INSCRIBED (ratingClassAlias) data layer and app-wide display follow-ups #61 will make this reachable.
ArcaeaRatingClassDisplay.of() silently masks bad input (ArcaeaRatingClassDisplay.kt:19-21) — an unknown alias/ratingClass combination falls back to the alias == null entry instead of failing. Given alias is a magic Int?, a fail-fast (error/require on non-null alias with no match) would catch future schema bugs sooner.
INSCRIBED path is currently dead in production — toRatingClassSelectorItems() (ArcaeaRatingClassSelector.kt:61) calls of(it.ratingClass) with the default alias = null, so no real Chart can ever resolve to INSCRIBED. This is acknowledged as groundwork, but the preview is the only place it's exercised.
Preview bug / confusing math: val itemsAll = itemsWithBeyond + itemsWithEternal.last() (ArcaeaRatingClassSelector.kt:361) is cryptic and actually just equals "beyond + eternal" (no Inscribed). Since INSCRIBED aliases to the Beyond slot you can't show all six together anyway — consider documenting that or simplifying to itemsCommon + beyondItem + eternalItem.
Naming: top-level SelectorSlotRatingClasses / SelectorOptionalSlotRatingClasses (ArcaeaRatingClassSelector.kt:290,302) are PascalCase non-const vals; convention would be camelCase. Minor.
Minor: the animateFloatAsState blur label is duplicated as "selectedTextShadowOffset" (ArcaeaRatingClassSelector.kt:199) — pre-existing typo, could fix while here.
Note (no change required)
Material kolor 5.0.1 resolves (verified against Maven Central), and the new com.materialkolor.hct.Hct usage compiles for the stable variant.
Verdict: solid refactor, behavior preserved. Only ask the author to address #1/#2 (future-proofing correctness) before merge; the rest are polish.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ArcaeaRatingClassSelectorparameters and follow Compose practices