Reserve chat list viewport above labeled navigation

This commit is contained in:
2026-11-07 21:10:23 +00:00
parent bbcfcd32a2
commit 0098662b06
7 changed files with 276 additions and 57 deletions
@@ -107,6 +107,60 @@ void main() {
},
);
testWidgets('compact focus and execution labels are explicit beyond shapes', (
tester,
) async {
final semantics = tester.ensureSemantics();
final gateway = FakeChatGateway()
..sessionsReply = {
'chat_sessions': [
{
'id': 'a',
'title': 'Active title',
'activity': {'turn_running': true, 'seq': 1},
},
{'id': 'b', 'title': 'Visible title'},
],
};
final controller = ChatSessionsController(
ChatRepository(gateway),
localStore: MemoryChatSessionLocalStore(),
);
final folds = ChatSectionFolds();
addTearDown(controller.dispose);
addTearDown(folds.dispose);
addTearDown(gateway.pushed.close);
await controller.refresh();
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: ChatCompactSidebar(
controller: controller,
folds: folds,
activeSessionId: 'a',
visibleSessionIds: const {'a', 'b'},
onOpen: (_) {},
onExpand: () {},
),
),
),
);
await tester.pump();
final tips = tester.widgetList<Tooltip>(find.byType(Tooltip));
final active = tips
.firstWhere((t) => t.message!.startsWith('Active title'))
.message!;
final visible = tips
.firstWhere((t) => t.message!.startsWith('Visible title'))
.message!;
expect(active, contains('Active chat'));
expect(active, contains('Working'));
expect(visible, contains('Visible chat'));
expect(find.bySemanticsLabel(RegExp('Working')), findsWidgets);
expect(find.bySemanticsLabel(RegExp('Visible chat')), findsWidgets);
semantics.dispose();
});
for (final cupertino in [false, true]) {
for (final brightness in Brightness.values) {
testWidgets(