Repository navigation
feat(phone): weight text size preference for weight-selection surfaces (#1367) - #1399
Conversation
#1367) Adds a device-local Settings -> Appearance -> Weight text size preference (Standard / Large / Extra large; nominal 1 / 1.5 / 2) that enlarges weight values on the safety-critical weight surfaces: Set Ready, Routine Overview and Rest Timer weight sliders (SliderWithButtons isWeightValue opt-in), both Workout HUD value branches (numeric/Adaptive and bodyweight), and the WeightStepper numeric value. SD1 rendered cap: style multiplier M = E/O with E = min(A*O, 2) applied to fontSize and explicit sp line height; every layout decision uses E. SD2: Standard keeps M = 1 through OS 200% with the documented above-cap bound. SD4/Option B: Just Lift, CompactNumberPicker and shouldStackWeightCards are unchanged. SD6: enum name under settings key weight_text_scale riding the existing globalSettings flow (Settings destination still collects exactly 3 flows); not in profile overlay, portal codec or backup codec. SD8: verbatim signoff helper copy, no 3x option. Tests: 24 new tests (WeightTextScaleTest, WeightTextScalingTest, WeightTextSizeSurfaceGuardTest, WeightTextScaleAndroidConversionTest, LocalWeightTextScaleDefaultTest, SettingsPreferencesManagerTest, SettingsManagerTest, WindowSizeClassTest and ProfileSettingsSeparationContractTest extensions). Full host suite green: 5784 tests, 0 failures (test-results XML aggregate). Fixes #1367
…le (#1367) The rendered-cap weight-text style helper (WeightTextScaling.kt) was placed in shared/src/commonMain, but it imports androidx.compose.ui (TextStyle, TextUnit, LocalDensity, sp). commonMain is shared verbatim with :shared-tvos, whose commonMain dependency graph has only cmp.runtime — never cmp.ui (cmp.ui is a phoneMain-only dependency). So :shared-tvos:compileKotlinTvosSimulatorArm64 and :shared-tvos:compileKotlinTvosArm64 failed with "Unresolved reference 'ui'", breaking the native-tv and native-tv-device CI checks. Move the file unchanged into shared/src/phoneMain/presentation/util/ (same package), alongside WindowSizeClass.kt and LocalWeightTextScale.kt. All five public helpers are consumed only by phoneMain surfaces (SliderWithButtons, WeightStepper, RoutineOverviewScreen, WorkoutHud); no commonMain/iosMain/ tvosMain code references them. commonTest sees phoneMain (precedent: WindowSizeClassTest -> WindowSizeClass), so WeightTextScalingTest keeps compiling, and :shared-tvos never compiles commonTest (its WindowSizeClassTest androidx.compose.ui.unit.dp import is green on the base commit). This is a pure relocation: zero behavior change, no tvOS/backup/schema scope touched.
Resolve localized strings conflicts by keeping both appended string blocks (1367 weight-text-size + 1360 rest-control feedback) in de/es/fr/it/nl.
|
Merge conflict resolution + re-verification (implementation worker, run 10)
Merge commit Local verification on the merge result (JDK 21,
Note: the earlier |
Final visual evidence — weight text size (#1367)In-app screenshots captured from the implementation branch (head Rendered-size proof (workout HUD bottom-bar
|
| OS text size | Standard | Large | Extra large |
|---|---|---|---|
100% (large) |
54 px (1.00×) | 82 px (1.52×) | 109 px (2.02×) |
~150% (accessibility-medium) |
— | — | 109 px (capped) |
~200% (accessibility-extra-large) |
87 px (1.61×) | 109 px (capped) | 109 px (capped) |
This matches the signed-off rendered-cap model E = min(A×O, 2) exactly: the rendered readout never exceeds 2× base at any device text size, Standard scales only with the OS (M = 1, the documented Standard-above-cap behaviour), and Extra large converges to the same capped size as Large once the cap binds. Measured programmatically (dark-glyph band height, identical frame position across cells).
Matrix frames (all on release v1.1.0)
Inline samples (Extra large at 100% vs Standard at 100%, then the Settings selector):
Full curated set (all …/releases/download/v1.1.0/issue1367-final-<name>):
- HUD bottom-bar readout across the matrix:
compact-os100-{STANDARD,LARGE,EXTRA_LARGE}-hud-workout-*.png,compact-os150-EXTRA_LARGE-hud-workout-*.png,compact-os200-{STANDARD,LARGE,EXTRA_LARGE}-hud-workout-*.png - Settings selector per OS scale (all three choices driven through the real control):
compact-os{100,150,200}-UI-settings-choice-{Standard,Large,Extra-large}.png - Signed-off helper copy (scrollable, unclipped):
compact-os100-UI-settings-help-bottom.png - Set Ready / pre-workout config A/B at OS 100%:
compact-os100-STANDARD-set-ready-STANDARD.png,compact-os100-EXTRA_LARGE-set-ready-EXTRA_LARGE.png - Option B control — Just Lift weight card at Extra large (deliberately unchanged in v1):
compact-os100-EXTRA_LARGE-hud-readout-EXTRA_LARGE.png
Capture boundaries (honest gaps)
- RestTimerCard and the in-routine SetReady/RoutineOverview weight sliders (
SliderWithButtonsisWeightValuesites) live in the routine-workout rest/set flow and need completed machine reps; they are not reachable in the simulator. Their wiring is proven by the committed tests (WeightTextSizeSurfaceGuardTest— 3 weight sites scaled / 5 rep sites byte-identical — plusWeightTextScalingTest,WeightTextScaleAndroidConversionTest,ProfileSettingsSeparationContractTest) and the signoff-stage prototype matrix (200 curated frames). Not faked here. - The routine-editor WeightStepper (rendered by
ExerciseConfigModal) and the Configure Exercise sheet's wheel pickers (CompactNumberPicker) render identically across choices in these frames — forCompactNumberPickerthat is correct signed-off behaviour (Option B/SD4 leaves Just Lift and the native picker untouched in v1); the scaledWeightSteppertreatment is proven by its unit tests and surface guard tests. - Capture-environment disclosures: the machine is the app's simulator fixture (
PHOENIX_SIMULATOR_FIXTURE=just-lift-connected); the app's "Set End Not Confirmed" safety dialog is acknowledged ("I checked") because no physical trainer exists in the capture environment; the EULA launch fixture seeds acceptance. No production behaviour depends on these.
This worker does not merge; handing to the escalated merge gate (phoenix-rca) — the PR body carries Fixes #1367 so merging closes the issue.
Union-resolve additive strings.xml conflicts (values, de, es, fr, it, nl): keep both this branch's weight-text-size strings and main's #1358 media strings. No other conflicts; presentation files auto-merged.
Main's 6f95247 (#1406) landed 64.sqm (RepBiomechanics aggregateEligible / velocity-loss clamp) without bumping the SD14 ratchet that ExerciseMediaWiringTest enforces. The guard comment sanctions the bump when a real migration lands; 64.sqm touches RepBiomechanics/WorkoutSession only and does not mention ExerciseImage, so guard (b) is unchanged. Pre-existing on clean main (both files byte-identical to origin/main); required for this PR's merge of main to pass :shared:testAndroidHostTest.
Merge follow-up: main integration + migration-ratchet fix (PR follow-up worker)Head updated
Verification (local, JDK 17,
CI on |
Merge gate — #1367 / PR #1399: not merged (new merge conflict)The escalated merge gate (phoenix-rca) audited head Passed:
Blocker: after follow-up, main moved Fix needed (PR follow-up): merge |
…-size # Conflicts: # shared/src/commonTest/kotlin/com/devil/phoenixproject/presentation/ExerciseMediaWiringTest.kt
Merge conflict resolution #2 — main integration (PR follow-up worker)
Resolution: merged Verification on the merged tree (local, JDK 17,
CI is now re-running on |
|
CI on head |
|
Merge gate: merged ✅ The escalated merge gate merged PR #1399 into What ships: a new Weight text size setting under Settings → Appearance, with Standard, Large and Extra large options. It enlarges the weight number on these screens:
The text grows up to about 2×. When the phone's own text size is also large, the effective size is capped so the two settings don't multiply each other. The setting is saved on each device. Just Lift is unchanged, and the stop-button request (#1366) is tracked separately. This feature is developed voluntarily at no charge. Gate audit:
The change will be in the next rolling release (v1.1.0 notes). |



Weight text size for weight-selection surfaces (issue #1367)
Fixes #1367 — larger weight-selection text for older-adult / low-vision trainees. The stop-button request (#1366) is a separate ticket and is not included here. The feature is developed voluntarily at no charge.
What ships
A device-local, global Settings → Appearance → Weight text size preference (Standard / Large / Extra large, nominal 1 / 1.5 / 2) placed after Theme and before Dynamic color, that enlarges weight values on the safety-critical weight surfaces:
SetReadyScreen)RoutineOverviewScreen)RestTimerCard) — per integration-model Correction 1Adaptive, and bodyweightNo machine load(both value branches; supportinglabelSmalllabels stay unscaled)WeightSteppernumeric value in exercise setup/editExplicitly unchanged (signoff Option B / SD4): Just Lift selection cards,
CompactNumberPicker,shouldStackWeightCards. Also unchanged: rep sliders (5 call sites stay byte-identical in behavior), secondary weight displays, units/rounding/BLE/saved data (presentation-only, SD12), tvOS, backup/portal/SQLDelight schemas.Binding design decisions (signoff corrections 1–7)
M = E/Owith effective rendered scaleE = min(A×O, 2)(WEIGHT_TEXT_MAX_EFFECTIVE_SCALE = 2.0f), applied tofontSizeand explicit splineHeight(SD3). Compose applies the OS scale exactly once, so rendered size isbase × E, physically capped at 2× base. Every layout decision usesE, neverA/M. Invalid/nonpositive/nonfinite inputs degrade to 1.0. The Android ceiling is proven through the real platform density converter (TypedValue.applyDimension) incl. nonlinear large-fontscaledDensity— with a negative control proving the test catches the uncapped×Aregression.M = 1through OS 200%; above the cap it is intentionally bounded (documented in the Settings help copy).SliderWithButtons.isWeightValue: Boolean = false; only the 3 weight sites passisWeightValue = true. Re-census on this branch (main@4d4de558): 3 weight / 5 rep = 8 call sites (RestTimerCard:577 weight / :530 rep, RoutineOverviewScreen:753 weight / :686,741 rep, SetReadyScreen:712 weight / :673,726 rep — classification re-derived, not inherited).weight_text_scale;UserPreferences.weightTextScale→SettingsPreferencesManager→SettingsManager(field absent fromoverlayProfile) →MainViewModel.SettingsGlobalUiState→ existingglobalSettingsflow (Settings destination still collects exactly 3 flows — contract test extended) →SettingsTab→EnhancedMainScreenCompositionLocalProvider(LocalWeightTextScale). Not inCoreProfilePreferences, portal codec, or backup codec; backup restore never writes the key.toggleable,Role.RadioButton, ≥48dp, child radioonClick = nullto avoid duplicate announcements) for compact/large-text layouts; segmented only where the labels fit. Effective scaleEdrives compact weight-header stacking (even at OS 1.0),WeightSteppervalue-own-row atE > 1.5, and the Routine Overview reduced-viewport condition.shouldStackWeightCardsbyte-identical.Standard/Large/Extra large. No 3× option.Test evidence (exact commands, main@
4d4de558+ this branch)JDK 17 (
/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home), discovered task names (SD13 —testDebugUnitTestdoes not exist on current main):./gradlew :shared:testAndroidHostTest -Pskip.supabase.check=true— BUILD SUCCESSFUL, 5784 tests, 0 failures (JUnit XML aggregate over 558 result files; full host suite incl.WeightDisplaySourceGuardTest+WeightFeatureGuardTestpassing unchanged — T21)../gradlew :shared:compileTestKotlinIosSimulatorArm64 :shared:iosSimulatorArm64Test -Pskip.supabase.check=true— compile green. The iOS test run is environmentally red on this host: a clean-main control run (origin/main@4d4de558, separate worktree, same command) fails 229 tests (allreadProjectFile-based source/SQL contract tests and sqliter simulator tests —docs/backend-handoff/*resolution under the Kotlin/Native test-runner CWD is broken here). This branch's run fails the same 229 plus 6 of the newWeightTextSizeSurfaceGuardTestsource-guards, which fail only at the samereadProjectFileresolution point (WeightTextSizeSurfaceGuardTest.kt:42) and are green in:shared:testAndroidHostTest. Pure-mathWeightTextScaleTest/WeightTextScalingTestpass on iOS. No test was disabled to pass; no regression vs. clean main. CI (ci-tests.yml) compiles the iOS target on PRs and does not run the iOS tests.New tests added (24):
WeightTextScaleTest(T1/T3),WeightTextScalingTest(T7–T10, T18),WeightTextSizeSurfaceGuardTest(T16/T17/T20 + SD4/SD12 invariants incl. backup-restore non-interference),SettingsPreferencesManagerTestextensions (T2/T3/T13 incl. write-error + last-choice ordering),SettingsManagerTestextension (T4 overlay survival),WindowSizeClassTestextensions (T19),ProfileSettingsSeparationContractTestextensions (T14 + SD8 verbatim copy),WeightTextScaleAndroidConversionTest(T11 Robolectric),LocalWeightTextScaleDefaultTest(T12).Presentation-only invariant (T22)
git diff origin/main --stattouches only presentation screens/components, the preference seam (UserPreferences/PreferencesManager/SettingsManager/MainViewModel), string resources, and tests. Nodata/ble/**,data/sync/**,sql/**,ProfilePreferencesCodec.kt,BackupModels.kt,DataBackupManager.kt, orshared/src/tvosMain/**changes.User summary / release note (from
user-instructions.md)New Settings → Appearance → Weight text size (Standard / Large / Extra large) enlarges weight values in Set Ready, Routine Overview, rest, exercise setup, and the workout readout (including Adaptive and bodyweight modes). Combines with device text size up to a 2× readable limit; Standard is unchanged at normal device text sizes. Saved on this device only (not part of app backup; restore never resets it) and applies immediately — select Standard to return to the default size. Just Lift is unchanged in this first version; no 3× option. Training data, weights, units, and machine behavior are unchanged. No charge.
Visual evidence
Final in-app screenshots are captured from this implementation branch (real app in the iOS simulator, XCUITest +
simctlcapture, real OS text-size settings viasimctl ui content_size) and uploaded to the coordinated rolling release tagv1.1.0. They are listed with release-asset links in an immediate follow-up PR comment (per pipeline convention: no local filesystem paths in public comments) and recorded in ticket state (final_visual_artifacts,final_visual_summary,final_visual_captured_at). The §6 matrix frames (all app choices × OS text sizes on a compact phone; short/tablet spot coverage) land in that comment.Merge gate
This worker never merges. Handing to the escalated merge gate (
phoenix-rca) when checks are green. Issue closes via theFixes #1367keyword on merge.