Repository navigation
Conversation
The card's headline row put the cycle day and "counted from your last logged start" side by side with nothing allowed to wrap, and its header put the label before a Spacer and the phase pill. At a 390 pt phone width the headline overflowed at default size in the test font, and both rows overflowed at large system text (iOS reaches 3.1x). The caption is Flexible now, and the header is a Wrap: label and pill side by side when they fit, the pill on its own line when not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The component sweep covers the gallery, and no screen is in it. A new sweep renders seven screens from preloaded data at 390 pt with the bundled font, in English and German, at 1x, 2x and 3.1x text. On top of the cycle-day card (previous commit) it found: - Readiness: the score and band label inside the fixed 150 pt ring were 260 pt taller than the ring at 3.1x. They now scale down to fit it. - Heart-rate zones: the bpm range overflowed its row at 3.1x. At large text it may now wrap; at 1x the row is unchanged. - MetricRow: at large text the value gets its own line but still could not wrap, so a value that is a phrase (the cycle "What applies to you" row, in German) overflowed. It wraps there now; the one-line layout is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideUIAllow heart-rate zone ranges to wrap only at large text sizes and keep the bpm unit attached to its range.
Let large-text MetricRow values wrap on their own line while preserving the one-line layout and its measurement behavior.
Make the cycle-day header and caption wrap when their text and phase pill do not fit.
Scale the readiness score and band label down to fit inside the fixed-size ring at large text sizes.
TestsAdd a localized, multi-size screen sweep and focused cycle-card tests to catch text overflows across screens and cycle layouts.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="lib/ui2/activity/zones.dart" line_range="507" />
<code_context>
+ style: F.n17.copyWith(color: p.ink2),
+ ),
+ TextSpan(
+ text: ' ${l?.activityZonesBpmUnit ?? 'bpm'}',
+ style: F.cap.copyWith(color: p.ink3),
+ ),
</code_context>
<issue_to_address>
**Bpm unit separates from range**
When large text constrains the range column to a width that fits the numbers but not the numbers plus unit, the ordinary space creates a line-break opportunity, so when the range and unit do not fit the allocated width but the range does, `Text.rich` puts “bpm” on a separate line from the reading.
Use a nonbreaking space between the range and its unit.
</issue_to_address>
### Comment 2
<location path="test/cycle_day_row_overflow_test.dart" line_range="44-46" />
<code_context>
+ addTearDown(t.view.reset);
+ final app = AppState.forTesting()..repo = _Repo(median: median);
+ addTearDown(app.dispose);
+ await t.pumpWidget(ChangeNotifierProvider<AppState>.value(
+ value: app,
+ child: MediaQuery(
+ data: MediaQueryData(textScaler: TextScaler.linear(scale)),
+ child: MaterialApp(
</code_context>
<issue_to_address>
**Cycle tests never apply large text**
When the dedicated cycle tests run their 3.1× cases, `MaterialApp` installs its own `MediaQuery`, overriding the scaler wrapped around it, so both scale variants run at the default size and the long no-median caption's large-text overflow goes undetected.
Set the `MediaQuery` scaler inside `MaterialApp.builder`, as the screen sweep does.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: test/cycle_day_row_overflow_test.dart:46
… Beats, What changed Every screen that takes preloaded data is now swept, 14 in all. The seven added here are clean in English and German at 1x, 2x and 3.1x; each was checked to render its content (no spinner, 8 to 55 text widgets), not an empty shell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review on OpenStrap#713: at large text a long phase name ended in an ellipsis. The pill wraps there now and stays one line at default sizes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review on OpenStrap#714: the ordinary space before the unit was a break point, so at large text "bpm" could wrap onto a line of its own. A no-break space keeps it with the number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All eight are clean; a long translation added later now fails here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Builds on #713 (its commit is the first one here). Review or merge #713 first; this PR's own changes are the later commits.
Summary
ui2_component_sweep_testchecks every gallery component at phone text sizes, but no screen is in the gallery, so cards a screen builds for itself were never checked. This PR addstest/ui2_screen_sweep_test.dart:RenderFlexoverflow and names the screen and source line.It found these, all fixed here or in #713. The other ten screens are clean at every size in every language. With these fixtures, some show a partial state (HR zones with no measured ceiling, Circadian before a rhythm is established, Home before band data), but each was checked to render its content (no spinner, 8 to 55 text widgets), not an empty shell:
FittedBox(scaleDown)inside the ringMetricRowvalue 32 pt too wideMetricRow(shared component). At large text (bigText, scale above 1.3) the row already gives the value a line of its own, but the value still couldn't wrap. That's fine for numbers, but a value that is a phrase overflowed. On that layout only, the value is nowFlexiblewith no line limit. The one-line layout and its "never truncate a measurement" rule are untouched.Testing
flutter test test/ui2_screen_sweep_test.dart: 24 cases (8 languages × 3 sizes, 14 screens each) pass, in about 4 s. With the threelib/changes stashed, it fails and names exactly the overflows above.--concurrency=1): 1,550 passed. That includesui2_component_sweep_test, which sweepsMetricRowat 1.0–3.1×.ui2_sleep_detail_load_failure_testandui2_wellness_load_failure_testfailed once. Both pass alone and serially, on this branch and onmain, so they look flaky under load, not affected by this change.flutter analyze: no issues.No screenshots: there's no device build here. At 1× the layouts are unchanged (the sweep's 1× runs were already clean before the fixes).
Risks and rollback
MetricRowis used app-wide, but the change applies only to the large-text layout, and the component sweep covers it.The readiness number shrinks inside the ring at very large text instead of spilling out of it.
Revert the commits to roll back.
Tests pass
Analyze passes
No secrets or debug code
Self-review completed
Human approval required before merge
🤖 Generated with Claude Code
Summary by Sourcery
Make UI2 screens resilient to large text and localized content while adding comprehensive screen-level overflow coverage.
New Features:
Bug Fixes:
Enhancements:
Tests: