Chat: hide the chat list entirely (Ctrl+B / Cmd+B), per device

ListDetailPanes takes listHidden and slides the list to zero width (at once
with reduced motion), keeping its expanded or compact mode for when it comes
back. A wide chat offers Hide chat list in the list's bar and the pane menu,
Ctrl+B (Cmd+B on Apple; a focused terminal keeps Ctrl+B) and, while hidden,
a Show chat list button at the start of the top-left pane's bar. The choice
is device-local (pipelines.chat.listHidden.v1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 21:33:05 +00:00
parent 22ab20077b
commit 109ea72252
15 changed files with 631 additions and 11 deletions
@@ -6,6 +6,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/application/pipelines_app.dart';
import 'package:pipelines_app/core/transport/pipelines_client.dart';
import 'package:pipelines_app/features/chat/conversation/chat_thread_view.dart';
import 'package:pipelines_app/features/chat/workspace/chat_list_hidden_controller.dart';
import '../core/transport/pipelines_client_test.dart' show FakeChannel;
import 'chat_registration_test.dart'
@@ -269,4 +270,31 @@ void main() {
},
variant: TargetPlatformVariant.only(TargetPlatform.macOS),
);
testWidgets('with the chat list hidden the switcher still opens and '
'switches', (tester) async {
final hidden = ChatListHiddenController.instance;
hidden.value = true;
addTearDown(() => hidden.value = false);
final provider = _provider();
final channel = await _mountOnChat(tester, provider);
expect(find.byKey(const Key('chat-show-list')), findsOneWidget);
await _chord(tester, LogicalKeyboardKey.controlLeft);
expect(_field, findsOneWidget);
await tester.enterText(_field, 'second');
await tester.pump();
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
await tester.pump();
await replySubscribe(tester, channel, index: 1);
await replyHistory(tester, channel, index: 1);
await tester.pumpAndSettle();
expect(provider.value.uri.path, '/chat/s2');
expect(_composerFocused(tester, 's2'), isTrue);
// Switching leaves the list hidden.
expect(hidden.value, isTrue);
expect(find.byKey(const Key('chat-show-list')), findsOneWidget);
expect(tester.takeException(), isNull);
await _teardown(tester);
});
}