From 2fe08226f20f32ac33daa5bfa029b19ace7bef92 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Sun, 8 Nov 2026 00:59:00 +0000 Subject: [PATCH] Show shared resize grips on wide chat pane dividers --- .../chat/workspace/chat_divider_grip.dart | 51 +++++++++++++++++++ .../workspace/chat_mobile_peek_divider.dart | 35 +------------ .../workspace/chat_workspace_divider.dart | 34 +++++++++---- app/notes/chat-pane-divider-grips.md | 8 +++ 4 files changed, 86 insertions(+), 42 deletions(-) create mode 100644 app/lib/features/chat/workspace/chat_divider_grip.dart create mode 100644 app/notes/chat-pane-divider-grips.md diff --git a/app/lib/features/chat/workspace/chat_divider_grip.dart b/app/lib/features/chat/workspace/chat_divider_grip.dart new file mode 100644 index 00000000..eb9f9b4e --- /dev/null +++ b/app/lib/features/chat/workspace/chat_divider_grip.dart @@ -0,0 +1,51 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../../../ui/adaptive/host.dart'; + +/// The same visible resize affordance for a mobile peek or a split pane. +class ChatDividerGrip extends StatelessWidget { + const ChatDividerGrip({ + super.key, + this.axis = Axis.horizontal, + this.emphasized = false, + this.compact = false, + }); + + final Axis axis; + final bool emphasized; + final bool compact; + + @override + Widget build(BuildContext context) { + final cupertino = usesCupertinoHost(context); + return RotatedBox( + quarterTurns: axis == Axis.vertical ? 1 : 0, + child: DecoratedBox( + decoration: BoxDecoration( + color: cupertino + ? CupertinoColors.secondarySystemBackground.resolveFrom(context) + : Theme.of(context).colorScheme.surfaceContainerHigh, + borderRadius: BorderRadius.circular(8), + border: emphasized + ? Border.all( + color: cupertino + ? CupertinoTheme.of(context).primaryColor + : Theme.of(context).colorScheme.primary, + ) + : null, + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: compact ? 6 : 8), + child: Icon( + cupertino ? CupertinoIcons.minus : Icons.drag_handle, + size: compact ? 12 : 18, + color: cupertino + ? CupertinoColors.secondaryLabel.resolveFrom(context) + : Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + ), + ); + } +} diff --git a/app/lib/features/chat/workspace/chat_mobile_peek_divider.dart b/app/lib/features/chat/workspace/chat_mobile_peek_divider.dart index 1b5d78d8..b6be0936 100644 --- a/app/lib/features/chat/workspace/chat_mobile_peek_divider.dart +++ b/app/lib/features/chat/workspace/chat_mobile_peek_divider.dart @@ -1,8 +1,7 @@ import 'dart:math' as math; import 'package:flutter/services.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import '../../../ui/adaptive/host.dart'; +import 'chat_divider_grip.dart'; /// A transparent touch target centred on the active chat's coloured bottom /// border. Height is bounded by the original 20% peek and a nonzero minimum. @@ -72,37 +71,7 @@ class _ChatMobilePeekDividerState extends State { onVerticalDragCancel: () => _dragHeight = null, child: Tooltip( message: 'Drag to resize inactive chat', - child: Center( - child: DecoratedBox( - decoration: BoxDecoration( - color: usesCupertinoHost(context) - ? CupertinoColors.secondarySystemBackground.resolveFrom( - context, - ) - : Theme.of(context).colorScheme.surfaceContainerHigh, - borderRadius: BorderRadius.circular(8), - border: _focused - ? Border.all( - color: usesCupertinoHost(context) - ? CupertinoTheme.of(context).primaryColor - : Theme.of(context).colorScheme.primary, - ) - : null, - ), - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Icon( - usesCupertinoHost(context) - ? CupertinoIcons.minus - : Icons.drag_handle, - size: 18, - color: usesCupertinoHost(context) - ? CupertinoColors.secondaryLabel.resolveFrom(context) - : Theme.of(context).colorScheme.onSurfaceVariant, - ), - ), - ), - ), + child: Center(child: ChatDividerGrip(emphasized: _focused)), ), ), ), diff --git a/app/lib/features/chat/workspace/chat_workspace_divider.dart b/app/lib/features/chat/workspace/chat_workspace_divider.dart index 003e031d..451c274b 100644 --- a/app/lib/features/chat/workspace/chat_workspace_divider.dart +++ b/app/lib/features/chat/workspace/chat_workspace_divider.dart @@ -4,6 +4,7 @@ import 'package:flutter/services.dart'; import '../../../ui/adaptive/host.dart'; import 'chat_workspace_controller.dart'; +import 'chat_divider_grip.dart'; import 'chat_workspace_geometry.dart'; /// A standard separator with a mouse/touch grab area and keyboard resizing. @@ -93,15 +94,30 @@ class _ChatWorkspaceDividerState extends State { }, onPanEnd: (_) => setState(() => _drag = null), onPanCancel: () => setState(() => _drag = null), - child: Center( - child: Container( - width: verticalLine - ? (_hovered || _focused || _drag != null ? 3 : 1) - : null, - height: verticalLine - ? null - : (_hovered || _focused || _drag != null ? 3 : 1), - color: color, + child: Tooltip( + message: 'Drag to resize chat panes', + child: Stack( + fit: StackFit.expand, + children: [ + Center( + child: Container( + width: verticalLine + ? (_hovered || _focused || _drag != null ? 3 : 1) + : null, + height: verticalLine + ? null + : (_hovered || _focused || _drag != null ? 3 : 1), + color: color, + ), + ), + Center( + child: ChatDividerGrip( + axis: verticalLine ? Axis.vertical : Axis.horizontal, + compact: true, + emphasized: _hovered || _focused || _drag != null, + ), + ), + ], ), ), ), diff --git a/app/notes/chat-pane-divider-grips.md b/app/notes/chat-pane-divider-grips.md new file mode 100644 index 00000000..3efd3f40 --- /dev/null +++ b/app/notes/chat-pane-divider-grips.md @@ -0,0 +1,8 @@ +# Visible pane divider grips + +Wide/browser and unfolded pane separators now use the same native-theme grip +as mobile quick switch, rotated for side-by-side panes. A compact grip fits the +existing 12-pixel divider; split geometry and resize limits are unchanged. +Hover/focus/drag highlights the grip. Existing mouse/touch/keyboard resizing and +double-click reset remain on the same hit target. Mobile keeps its existing grip +size and appearance through the shared widget.