Chat stack: polish pile layers, dark tone, Add chat picker title, probe param

This commit is contained in:
2026-12-03 20:18:14 +00:00
parent fd62df3815
commit e629d552c2
7 changed files with 39 additions and 26 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ mixin _ChatScreenStack on State<ChatScreen>, _ChatScreenWorkspace {
child: ChatStackFab(
entries: _stackEntries(),
onOpen: (entry) => _openBySelection(entry.session),
onAdd: _addPane,
onAdd: (context) => _addPane(context, title: ChatStackColumn.addLabel),
onRemove: _removeFromStack,
),
),
@@ -450,7 +450,7 @@ mixin _ChatScreenWorkspace on State<ChatScreen> {
},
);
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<ChatScreen> {
context,
controller: _sessionsForSidebar,
sidebarFolds: _foldsForSidebar,
title: title,
excludedSessionIds: _workspace.panes
.map((pane) => pane.sessionId)
.toSet(),
@@ -15,6 +15,7 @@ Future<void> showAddChatPanePicker(
required ChatSectionFolds sidebarFolds,
required Set<String> excludedSessionIds,
required ValueChanged<JsonMap> onSelected,
String title = 'Add chat pane',
}) async {
final selected = await showAppChoiceMenu<JsonMap>(
context,
@@ -27,6 +28,7 @@ Future<void> showAddChatPanePicker(
builder: (context, constraints) => SizedBox(
height: constraints.maxHeight,
child: _AddChatPanePicker(
title: title,
controller: controller,
sidebarFolds: sidebarFolds,
excludedSessionIds: excludedSessionIds,
@@ -53,10 +55,12 @@ Future<void> 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<String> 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,
),
),
+1
View File
@@ -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';
@@ -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,
@@ -45,9 +45,9 @@ class ChatStackPose {
/// so the pile reads as cards rather than one disc.
const List<ChatStackPose> 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.
@@ -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=<ms>` (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<void> 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') {