Repository navigation
fix: sweep whole screens at large text and fix the overflows it found #714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
abdulsaheel
merged 8 commits into
OpenStrap:main
from
kurexw:fix/large-text-screen-sweep
Nov 14, 2026
+500
−35
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e82c8bb
Cycle: let the day-in-cycle card wrap instead of overflowing
0dab101
Sweep whole screens at large text, and fix the three that overflowed
d816de6
Sweep test: drop three unneeded imports
40ee26c
Screen sweep: add Home, Health, Investigate, Metric detail, Timeline,…
637bd53
Cycle: let the phase pill wrap at large text
e473440
Merge the cycle pill fix from #713
fc44401
Zones: keep "bpm" on the same line as its range
705d66b
Screen sweep: run every shipped language, not only en and de
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| // The cycle screen's "day in this cycle" card must fit a phone at any text | ||
| // size. | ||
| // | ||
| // The headline row put the day number and "counted from your last logged | ||
| // start" side by side with nothing allowed to wrap, and the header row put | ||
| // its label before a Spacer and the phase pill. At a 390 pt width that | ||
| // overflowed by 147 pt in the test font, and by less, but still, with larger | ||
| // system text (iOS goes to 3.1x) or a longer language. | ||
|
|
||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_test/flutter_test.dart'; | ||
| import 'package:provider/provider.dart'; | ||
|
|
||
| import 'package:openstrap_edge/data/local_repository.dart'; | ||
| import 'package:openstrap_edge/state/app_state.dart'; | ||
| import 'package:openstrap_edge/ui2/screens/cycle_screen.dart'; | ||
| import 'package:openstrap_edge/ui2/ui2.dart'; | ||
|
|
||
| class _Repo extends LocalRepository { | ||
| _Repo({this.median}); | ||
| final num? median; | ||
|
|
||
| @override | ||
| Future<Map<String, dynamic>> getCycle() async => { | ||
| 'enabled': true, | ||
| 'phase': 'follicular', | ||
| 'cycle_day': 5, | ||
| 'median_length': ?median, | ||
| 'logs': [ | ||
| {'date': '2026-11-09', 'kind': 'start'}, | ||
| ], | ||
| }; | ||
|
|
||
| @override | ||
| Future<Map<String, List<String>>> getCycleSymptoms() async => const {}; | ||
| } | ||
|
|
||
| Future<void> _pump(WidgetTester t, {num? median, double scale = 1}) async { | ||
| t.view.physicalSize = const Size(390 * 3, 4000 * 3); | ||
| t.view.devicePixelRatio = 3; | ||
| 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( | ||
|
sourcery-ai[bot] marked this conversation as resolved.
Resolved
|
||
| data: MediaQueryData(textScaler: TextScaler.linear(scale)), | ||
| child: MaterialApp( | ||
| theme: buildTheme(Brightness.light), | ||
| home: const Scaffold(body: CycleTab()), | ||
| ), | ||
| ), | ||
| )); | ||
| await t.pumpAndSettle(); | ||
| } | ||
|
|
||
| void main() { | ||
| for (final scale in const [1.0, 3.1]) { | ||
| testWidgets('no median yet, ${scale}x text', (t) async { | ||
| // The pump is the assertion: a RenderFlex overflow fails it. | ||
| await _pump(t, scale: scale); | ||
| expect(find.textContaining('counted from your last logged start'), | ||
| findsOneWidget); | ||
| }); | ||
|
|
||
| testWidgets('with a median, ${scale}x text', (t) async { | ||
| await _pump(t, median: 29, scale: scale); | ||
| expect(find.textContaining('of about 29'), findsOneWidget); | ||
| // The phase name wraps at large text instead of ending in an ellipsis. | ||
| expect(t.widget<Pill>(find.byType(Pill).first).wrap, scale > 1.3); | ||
| }); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the unit in the same text flow as a wrapped value.
At large text, the
Flexiblevalue can wrap onto several lines. The unit remains a separateRowchild, so it aligns with the value's first line and stays beside it. Callers such as the heart-rate range inlib/ui2/screens/health_screen.dart:1184-1186pass a non-empty unit ('bpm') with a value that can wrap. Render the value and unit in one text flow at large text, so the unit follows the final line of the value. Phrase-valued rows such aslib/ui2/screens/cycle_screen.dart:441-445pass no unit, so they are not affected.