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
@@ -3,7 +3,8 @@ import 'package:shared_preferences/shared_preferences.dart';
const mobileChatNavigationKey = 'pipelines.mobile-chat-navigation.v1';
/// How a phone-width layout moves between the open chats.
/// How a phone-width layout (and any layout on a phone or tablet, an unfolded
/// foldable too, for the Chat stack) moves between the open chats.
enum MobileChatNavigation {
quickSwitch(
'Quick switch',
@@ -59,7 +60,11 @@ class MobileChatNavigationController extends ChangeNotifier {
static final instance = MobileChatNavigationController();
final MobileChatNavigationStore _store;
MobileChatNavigation _value = MobileChatNavigation.quickSwitch;
/// Without a stored choice, the Chat stack.
static const fallback = MobileChatNavigation.chatStack;
MobileChatNavigation _value = fallback;
int _revision = 0;
bool _disposed = false;
bool saveFailed = false;
@@ -91,6 +96,16 @@ class MobileChatNavigationController extends ChangeNotifier {
notifyListeners();
}
/// Sets [mode] without saving it (a test's starting point).
@visibleForTesting
void debugUse(MobileChatNavigation mode) {
_revision++;
saveFailed = false;
if (mode == _value) return;
_value = mode;
notifyListeners();
}
@override
void dispose() {
_disposed = true;