ultrawide layout test coverage + shared setSurfaceSize helper (T-241)

Add setSurfaceSize(tester, width) to the widget harness — the reusable way to
test width-sensitive layout at an ultrawide surface (a wide SizedBox under the
default 800px surface is clamped, so the view's physicalSize must be set), the
foundation T-241 asked for.

Ultrawide cases on the surfaces most prone to width-proportional bugs (the T-239
class): ClideMarquee stays static when a line fits a 3440 slot (it was only
tested narrow); the quick-open palette stays width-capped, not stretched edge to
edge. The status bar already covers 600+3440 (T-239).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-09 22:34:16 +02:00
co-authored by Claude Opus 4.8
parent 7d8f58690f
commit 1411e19ab4
5 changed files with 58 additions and 0 deletions
+14
View File
@@ -89,3 +89,17 @@ Future<void> pumpAsync(WidgetTester tester) async {
await tester.pump();
await tester.pump(const Duration(milliseconds: 20));
}
/// Size the test surface to [width]×[height] for width-sensitive layout checks
/// (T-241). A wide SizedBox under the default 800px surface is CLAMPED, so the
/// view's physicalSize must be set directly. Auto-resets after the test. Pass an
/// ultrawide width (e.g. 3440) alongside a normal one to catch width-PROPORTIONAL
/// bugs that hide at 800px (the T-239 class of bug).
void setSurfaceSize(WidgetTester tester, double width, {double height = 800}) {
tester.view.physicalSize = Size(width, height);
tester.view.devicePixelRatio = 1.0;
addTearDown(() {
tester.view.resetPhysicalSize();
tester.view.resetDevicePixelRatio();
});
}