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:
@@ -6,6 +6,12 @@ part of 'screen.dart';
|
||||
/// workspace's panes, the same open chats the server syncs; choosing one
|
||||
/// opens it as a tap on its list row does, Add chat is the pane menu's Add
|
||||
/// chat pane, and removing one closes its pane.
|
||||
/// Whether this is a phone or tablet (Android or iOS, also a browser on one).
|
||||
bool chatStackOnMobile() => switch (defaultTargetPlatform) {
|
||||
TargetPlatform.android || TargetPlatform.iOS => true,
|
||||
_ => false,
|
||||
};
|
||||
|
||||
mixin _ChatScreenStack on State<ChatScreen>, _ChatScreenWorkspace {
|
||||
final LayerLink _stackLink = LayerLink();
|
||||
|
||||
@@ -15,10 +21,14 @@ mixin _ChatScreenStack on State<ChatScreen>, _ChatScreenWorkspace {
|
||||
MobileChatNavigationController get _navigation =>
|
||||
MobileChatNavigationController.instance;
|
||||
|
||||
/// Whether this layout navigates with the stack rather than the peek.
|
||||
/// Whether this layout navigates with the stack rather than the peek: on
|
||||
/// a phone-width window, and on a phone or tablet at any width (an
|
||||
/// unfolded foldable keeps the stack above the active pane). A wide
|
||||
/// desktop or web window keeps its panes alone.
|
||||
@override
|
||||
bool _stacked(BuildContext context) =>
|
||||
_navigation.stack && !showsListBesideDetail(context);
|
||||
_navigation.stack &&
|
||||
(!showsListBesideDetail(context) || chatStackOnMobile());
|
||||
|
||||
/// Gives the active pane the stack's spot.
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user