fix(audit): wrap overflow-menu labels instead of clipping them
A popup menu is width-capped at ~280px, so the full-sentence German entries in the audit overflow menu ran past the edge. The clipped tail of the reset entry was exactly the "(nur local/dev)" scope that keeps it from reading as "delete evidence", and the label's centre landed outside the hit box. Guard in responsive_test: the page-level overflow sweep cannot see popup menus (their width does not follow the window), which is why this went unnoticed. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
c6a0b1a267
commit
415f8a7ddb
3 changed files with 86 additions and 18 deletions
|
|
@ -69,4 +69,57 @@ void main() {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Popup menus have a hard width cap (~280px) that no window size
|
||||
// relaxes, so the page sweep above cannot see them overflow. The
|
||||
// audit overflow menu spells its entries out in full German
|
||||
// sentences — unwrapped, the tail was clipped, and on the reset
|
||||
// entry the clipped tail was the "(nur local/dev)" that keeps it
|
||||
// from reading as "delete evidence".
|
||||
testWidgets('audit overflow-menu entries wrap instead of overflowing', (
|
||||
tester,
|
||||
) async {
|
||||
installFakeHub();
|
||||
tester.view.physicalSize = const Size(1280, 800);
|
||||
tester.view.devicePixelRatio = 1.0;
|
||||
addTearDown(tester.view.reset);
|
||||
|
||||
await tester.pumpWidget(
|
||||
const StudioApp(
|
||||
initialThemeMode: ThemeModeValue.dark,
|
||||
initialLocale: Locale('de'),
|
||||
),
|
||||
);
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
await tester.tap(find.byKey(const ValueKey('sidebar-item-audit')));
|
||||
await tester.pump(const Duration(milliseconds: 400));
|
||||
|
||||
await tester.tap(find.byTooltip('Weitere Aktionen'));
|
||||
for (var i = 0; i < 6; i++) {
|
||||
await tester.pump(const Duration(milliseconds: 200));
|
||||
}
|
||||
expect(
|
||||
tester.takeException(),
|
||||
isNull,
|
||||
reason: 'the audit overflow menu threw during layout',
|
||||
);
|
||||
|
||||
// Every entry stays inside the menu it belongs to — a label
|
||||
// that overruns is not just ugly, it is unreadable and unhittable.
|
||||
final menu = tester.getRect(find.byType(PopupMenuItem<String>).first);
|
||||
for (final label in find.byType(PopupMenuItem<String>).evaluate()) {
|
||||
final text = find.descendant(
|
||||
of: find.byWidget(label.widget),
|
||||
matching: find.byType(Text),
|
||||
);
|
||||
expect(
|
||||
tester.getRect(text).right,
|
||||
lessThanOrEqualTo(menu.right + 0.5),
|
||||
reason: 'menu label runs past the menu edge',
|
||||
);
|
||||
}
|
||||
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pump(const Duration(minutes: 1));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue