Skip to content

fix(just-lift): avoid weight(1f) on weight cards inside verticalScroll (#574 follow-up) - #576

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-09a8
Closed

fix(just-lift): avoid weight(1f) on weight cards inside verticalScroll (#574 follow-up)#576
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-09a8

Conversation

@cursor

@cursor cursor Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

PR #574 (#571 fix) introduced a layout crash on iPhone portrait with Bold Text or large Dynamic Type enabled.

When useCompactAccessibility is true, the outer Column uses verticalScroll. The PR changed weight-card modifiers to gate Modifier.weight(1f) only on stackWeightCards, but stackWeightCards stays false on tall portrait (by design, to avoid the wheel/slider gesture conflict). That leaves weight(1f) on children inside a vertically scrolling parent — an invalid Compose constraint that can fail layout with unbounded-height measure errors.

Trigger: iPhone portrait → Settings → Accessibility → Display & Text Size → Bold Text ON (or Dynamic Type ≥ ~1.15×) → Just Lift → Old School/Pump mode.

Root cause

Two independent layout gates were split (useCompactAccessibility for scroll, stackWeightCards for card sizing) without accounting for the intersection case where scroll is on but stacking is off.

Fix

Introduce weightCardsUseIntrinsicHeight = useCompactAccessibility || stackWeightCards and use it for weight-card weight / fillMaxSize modifiers. Modifier.weight(1f) is only applied when neither outer scroll nor short-height stacking applies (default portrait).

Added a source-level regression test in JustLiftScreenWeightSliderWiringTest.

Validation

  • Logic review of layout gate combinations (default portrait, bold-text portrait, short-height landscape)
  • Regression test added for the weight(1f) + verticalScroll invariant
  • Full Gradle test run blocked locally (no Android SDK in cloud agent); existing WindowSizeClassTest cases unchanged
Open in Web View Automation 

phoenix-bot and others added 2 commits June 17, 2026 16:29
…n iPhone portrait (#571)

Issue #571 reporter (iPhone 16 Pro, Just Lift, LB) saw the Weight Change Per Rep
slider produce 29/30/44-49 instead of 1 lb increments. RCA proved the slider is
correctly bound to valueRange = -10..+10 with 1 lb steps and cannot emit those
values; the visible jumps were the iOS CompactNumberPicker (LazyColumn wheel,
range 1..242 LB) claiming vertical drags intended for the slider and snapping
to neighbour weights.

This commit applies the three-part fix from the GPT-5.5 RCA:

1. WindowSizeClass.kt + JustLiftScreen.kt — split the side-by-side weight card
   gate from the broader useCompactAccessibility. New shouldStackWeightCards()
   returns true only when the screen is also short (height Compact), so iPhone
   portrait (402x874dp) with default Dynamic Type / Bold Text keeps the two
   weight cards side-by-side. iPhone landscape and short-height tablets still
   stack.
2. JustLiftScreen.kt — add an explicit Spacer(Spacing.small) between the two
   weight cards when stacked, belt-and-braces separation.
3. CompactNumberPicker.ios.kt — add a pointerInput on the wheel's BoxWithConstraints
   that consumes vertical drags landing outside the centred 36dp selected band,
   so the inner LazyColumn does not claim them. In edit mode the wheel defers
   entirely to the BasicTextField.

Adds WindowSizeClassTest cases for shouldStackWeightCards and a new
JustLiftScreenWeightSliderWiringTest that pins the ProgressionSlider's
valueRange and weightChangePerRep binding against future regressions.

Refs: #571 (Fixes)
RCA: rca_owner=gpt-5.5-xhigh, fix_driver=gpt55_rca
PR #574 split stackWeightCards from useCompactAccessibility for issue #571,
but Bold Text / large Dynamic Type still enables outer verticalScroll while
stackWeightCards stays false on tall portrait. Applying Modifier.weight(1f)
inside a scrolling Column uses unbounded height constraints and can crash at
layout time.

Gate intrinsic-height layout on useCompactAccessibility || stackWeightCards
and add a source-level regression test.

Co-authored-by: Devil <9thLevelSoftware@users.noreply.github.com>
@9thLevelSoftware
9thLevelSoftware deleted the cursor/critical-bug-investigation-09a8 branch June 17, 2026 21:43
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