Chat stack: the default, also on a wide phone or tablet; a close button where the pile was

Chat stack is now the default phone chat navigation (a stored choice is
kept), and on Android or iOS it stays on a wide layout (an unfolded
foldable) above the active pane, where floating is ignored too. When
expanded, the pile turns into a close button at its own spot and the
column rises above it; while a chat is dragged that button is the remove
target, replacing the separate x at the bottom. Chat widget tests start
on Quick switch (they run as Android); the stack's tests choose it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 21:47:57 +00:00
parent fba3b924f1
commit 130c1e6708
18 changed files with 344 additions and 184 deletions
@@ -11,7 +11,7 @@ import 'package:pipelines_app/features/chat/screen.dart';
import 'package:pipelines_app/features/chat/stack/chat_stack_column.dart';
import 'package:pipelines_app/features/chat/stack/chat_stack_disc.dart';
import 'package:pipelines_app/features/chat/stack/chat_stack_drag.dart';
import 'package:pipelines_app/features/chat/stack/chat_stack_remove_target.dart';
import 'package:pipelines_app/features/chat/stack/chat_stack_close_target.dart';
import 'package:pipelines_app/features/chat/stack/mobile_chat_navigation.dart';
import 'package:pipelines_app/features/chat/workspace/chat_workspace.dart';
import 'package:pipelines_app/shell/adaptive_shell.dart';
@@ -117,7 +117,7 @@ Finder _button(WidgetTester tester, String id) {
}
final _add = find.byKey(const ValueKey('chat-stack-button-add'));
final _target = find.byType(ChatStackRemoveTarget);
final _target = find.byType(ChatStackCloseTarget);
/// Holds [finder] until it lifts.
Future<TestGesture> _lift(WidgetTester tester, Finder finder) async {
@@ -127,7 +127,7 @@ Future<TestGesture> _lift(WidgetTester tester, Finder finder) async {
}
double _shown(WidgetTester tester) =>
tester.widget<ChatStackRemoveTarget>(_target).shown.value;
tester.widget<ChatStackCloseTarget>(_target).armed.value;
void main() {
final navigation = MobileChatNavigationController.instance;
@@ -182,7 +182,7 @@ void main() {
final from = tester.getCenter(_button(tester, 'b'));
await gesture.moveBy(tester.getCenter(_target) - from);
await tester.pumpAndSettle();
final drag = tester.widget<ChatStackRemoveTarget>(_target).hover;
final drag = tester.widget<ChatStackCloseTarget>(_target).hover;
expect(drag.value, 1);
await gesture.up();
await tester.pumpAndSettle();
@@ -308,9 +308,9 @@ void main() {
await gesture.moveBy(const Offset(0, -kChatStackPitch));
await tester.pump();
expect(tester.getCenter(_button(tester, 'b')).dy, b.dy + kChatStackPitch);
// No slide: the target sits in place.
// No turn or growth: the button only fades.
expect(
find.descendant(of: _target, matching: find.byType(SlideTransition)),
find.descendant(of: _target, matching: find.byType(RotationTransition)),
findsNothing,
);
await gesture.up();