From e629d552c2162da0974c65a8ecb1ea7fde271433 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Thu, 3 Dec 2026 20:18:14 +0000 Subject: [PATCH] Chat stack: polish pile layers, dark tone, Add chat picker title, probe param --- app/lib/features/chat/chat_screen_stack.dart | 2 +- .../features/chat/chat_screen_workspace.dart | 3 +- .../conversation/chat_add_pane_picker.dart | 6 +++- app/lib/features/chat/screen.dart | 1 + .../features/chat/stack/chat_stack_disc.dart | 36 +++++++++---------- .../features/chat/stack/chat_stack_pose.dart | 6 ++-- app/tool/search_selection_probe_entry.dart | 11 ++++++ 7 files changed, 39 insertions(+), 26 deletions(-) diff --git a/app/lib/features/chat/chat_screen_stack.dart b/app/lib/features/chat/chat_screen_stack.dart index 765b8c77..37b067cd 100644 --- a/app/lib/features/chat/chat_screen_stack.dart +++ b/app/lib/features/chat/chat_screen_stack.dart @@ -57,7 +57,7 @@ mixin _ChatScreenStack on State, _ChatScreenWorkspace { child: ChatStackFab( entries: _stackEntries(), onOpen: (entry) => _openBySelection(entry.session), - onAdd: _addPane, + onAdd: (context) => _addPane(context, title: ChatStackColumn.addLabel), onRemove: _removeFromStack, ), ), diff --git a/app/lib/features/chat/chat_screen_workspace.dart b/app/lib/features/chat/chat_screen_workspace.dart index 3b22551f..16cbbc7a 100644 --- a/app/lib/features/chat/chat_screen_workspace.dart +++ b/app/lib/features/chat/chat_screen_workspace.dart @@ -450,7 +450,7 @@ mixin _ChatScreenWorkspace on State { }, ); - void _addPane(BuildContext context) { + void _addPane(BuildContext context, {String title = 'Add chat pane'}) { // The action normally lives in the pane's More menu. Let that menu finish // closing before pushing the picker, otherwise its root-overlay teardown // can hide the newly opened anchored menu. @@ -461,6 +461,7 @@ mixin _ChatScreenWorkspace on State { context, controller: _sessionsForSidebar, sidebarFolds: _foldsForSidebar, + title: title, excludedSessionIds: _workspace.panes .map((pane) => pane.sessionId) .toSet(), diff --git a/app/lib/features/chat/conversation/chat_add_pane_picker.dart b/app/lib/features/chat/conversation/chat_add_pane_picker.dart index 71ae52bd..08303347 100644 --- a/app/lib/features/chat/conversation/chat_add_pane_picker.dart +++ b/app/lib/features/chat/conversation/chat_add_pane_picker.dart @@ -15,6 +15,7 @@ Future showAddChatPanePicker( required ChatSectionFolds sidebarFolds, required Set excludedSessionIds, required ValueChanged onSelected, + String title = 'Add chat pane', }) async { final selected = await showAppChoiceMenu( context, @@ -27,6 +28,7 @@ Future showAddChatPanePicker( builder: (context, constraints) => SizedBox( height: constraints.maxHeight, child: _AddChatPanePicker( + title: title, controller: controller, sidebarFolds: sidebarFolds, excludedSessionIds: excludedSessionIds, @@ -53,10 +55,12 @@ Future showAddChatPanePicker( class _AddChatPanePicker extends StatefulWidget { const _AddChatPanePicker({ + required this.title, required this.controller, required this.sidebarFolds, required this.excludedSessionIds, }); + final String title; final ChatSessionsController controller; final ChatSectionFolds sidebarFolds; final Set excludedSessionIds; @@ -89,7 +93,7 @@ class _AddChatPanePickerState extends State<_AddChatPanePicker> { Padding( padding: const EdgeInsetsDirectional.fromSTEB(24, 16, 24, 0), child: Text( - 'Add chat pane', + widget.title, style: Theme.of(context).textTheme.titleLarge, ), ), diff --git a/app/lib/features/chat/screen.dart b/app/lib/features/chat/screen.dart index a1f43b19..b41c0cee 100644 --- a/app/lib/features/chat/screen.dart +++ b/app/lib/features/chat/screen.dart @@ -42,6 +42,7 @@ import 'conversation/chat_sidebar_controls.dart'; import 'ui/sessions/chat_compact_sidebar.dart'; import 'workspace/chat_workspace.dart'; import 'stack/chat_stack_anchor.dart'; +import 'stack/chat_stack_column.dart'; import 'stack/chat_stack_entry.dart'; import 'stack/chat_stack_fab.dart'; import 'stack/mobile_chat_navigation.dart'; diff --git a/app/lib/features/chat/stack/chat_stack_disc.dart b/app/lib/features/chat/stack/chat_stack_disc.dart index 5795d1ac..7f317378 100644 --- a/app/lib/features/chat/stack/chat_stack_disc.dart +++ b/app/lib/features/chat/stack/chat_stack_disc.dart @@ -16,45 +16,41 @@ const double kChatStackPitch = kChatStackSlot + 8; /// The gap between an item's name label and its avatar. const double kChatStackLabelGap = 10; -/// An opaque disc in the design's shape (a circle, or a framed square under a -/// flat design) that carries one avatar of the stack. The list avatar's fill -/// is translucent; the disc keeps stacked avatars from showing through each -/// other, and its rim separates them. A raised design drops a short shadow; -/// a flat one keeps its hairline frame instead. +/// An opaque disc in the design's shape (a circle, or the design's square +/// under a flat design) that carries one avatar of the stack. The list +/// avatar's fill is translucent; the disc keeps stacked avatars from showing +/// through each other, and its rim separates them. A raised design drops a +/// short shadow; a flat one casts none, and its avatar frames itself. class ChatStackDisc extends StatelessWidget { - const ChatStackDisc({ - super.key, - required this.child, - this.ring, - this.shadow = true, - }); + const ChatStackDisc({super.key, required this.child, this.ring}); final Widget child; /// The rim's colour when it marks the current chat; null for the surface. final Color? ring; - /// Whether this disc may cast a shadow (a layer under another does not). - final bool shadow; - @override Widget build(BuildContext context) { final tokens = AppDesignTokens.of(context); final scheme = Theme.of(context).colorScheme; - final base = tokens.panelFill(scheme, scheme.surface); + // A raised dark design lifts the disc a tone, as Material's dark + // elevation does, so the pile's layers read where a shadow cannot. + final dark = Theme.of(context).brightness == Brightness.dark; + final base = tokens.panelFill( + scheme, + dark ? scheme.surfaceContainerHighest : scheme.surface, + ); final ring = this.ring; final shape = chatStackShape(tokens); - final frame = tokens.frameSide; return SizedBox.square( dimension: kChatStackSlot, child: Center( child: DecoratedBox( decoration: ShapeDecoration( color: ring ?? base, - shape: shape.copyWith( - side: ring == null && frame != null ? frame : BorderSide.none, - ), - shadows: shadow && !tokens.flat ? chatStackShadows(scheme) : null, + // A flat design's avatar frames itself; the rim stays bare. + shape: shape, + shadows: !tokens.flat ? chatStackShadows(scheme) : null, ), child: SizedBox.square( dimension: kChatStackDisc, diff --git a/app/lib/features/chat/stack/chat_stack_pose.dart b/app/lib/features/chat/stack/chat_stack_pose.dart index 04b6a5f1..b77bccbf 100644 --- a/app/lib/features/chat/stack/chat_stack_pose.dart +++ b/app/lib/features/chat/stack/chat_stack_pose.dart @@ -45,9 +45,9 @@ class ChatStackPose { /// so the pile reads as cards rather than one disc. const List chatStackLayers = [ ChatStackPose(), - ChatStackPose(offset: Offset(-4, -6), turn: -7 * math.pi / 180, scale: .94), - ChatStackPose(offset: Offset(4, -11), turn: 6 * math.pi / 180, scale: .88), - ChatStackPose(offset: Offset(-1, -15), turn: -4 * math.pi / 180, scale: .82), + ChatStackPose(offset: Offset(-7, -7), turn: -8 * math.pi / 180, scale: .94), + ChatStackPose(offset: Offset(4, -13), turn: 7 * math.pi / 180, scale: .88), + ChatStackPose(offset: Offset(-4, -18), turn: -4 * math.pi / 180, scale: .82), ]; /// How many avatars the collapsed stack draws. diff --git a/app/tool/search_selection_probe_entry.dart b/app/tool/search_selection_probe_entry.dart index b1485f7c..a4c3f429 100644 --- a/app/tool/search_selection_probe_entry.dart +++ b/app/tool/search_selection_probe_entry.dart @@ -1,3 +1,4 @@ +import 'package:pipelines_app/features/chat/stack/mobile_chat_navigation.dart'; import 'package:pipelines_app/application/pipelines_binding.dart'; import 'package:pipelines_app/core/servers/chat/chat_server_pool.dart'; import 'package:pipelines_app/core/servers/machine_access.dart'; @@ -988,6 +989,7 @@ class _FixtureSink implements WebSocketSink { /// `?speech=fake` reads replies aloud with a scripted engine, one word per /// `?speechStep=` ms (tool/probe_speech_fixture.dart); /// `?design=terminal` chooses that app design (Settings → Design); +/// `?chatNav=stack` navigates a phone's open chats with the Chat stack; /// `?poolDelay=` (with `?federated=1`) connects each machine that /// much later, as a real server does (a detached chat window's first list); /// `?theme=dark` / `?theme=light` pins the platform brightness the app's @@ -1032,6 +1034,15 @@ Future main() async { ? AppDesignController.instance.restore() : AppDesignController.instance.select(AppDesign.fromId(design)), ); + // `?chatNav=stack` chooses the phone's Chat stack as Settings would; + // otherwise the stored choice. + unawaited( + params['chatNav'] == 'stack' + ? MobileChatNavigationController.instance.setValue( + MobileChatNavigation.chatStack, + ) + : MobileChatNavigationController.instance.restore(), + ); _fillerRunCount = int.tryParse(params['runs'] ?? '') ?? 0; _fillerStepCount = int.tryParse(params['steps'] ?? '') ?? 0; if (params['running'] == '1') {