Drag chats from the list onto panes

On desktop a chat dragged from the list or compact rail onto a tiled
pane replaces that pane's chat when dropped in its centre, or opens in a
split right of or below it when dropped on that edge; an open chat moves
without duplicating and a floating chat docks.
This commit is contained in:
2026-11-13 12:45:42 +00:00
parent df0614e2f7
commit cb49aeef34
15 changed files with 313 additions and 30 deletions
@@ -17,12 +17,14 @@ import 'chat_pane_switch_motion.dart';
import 'chat_pane_backdrop.dart';
import 'chat_pane_dim.dart';
import 'chat_workspace_pane_scope.dart';
import 'chat_workspace_drop.dart';
import 'chat_workspace_surface.dart';
import '../../../ui/input/keyboard_owner.dart';
export 'chat_workspace_controller.dart';
export 'chat_workspace_geometry.dart' show ChatPaneDirection;
export 'chat_workspace_pane_scope.dart';
export 'chat_workspace_drop.dart';
typedef ChatWorkspacePaneBuilder =
Widget Function(BuildContext context, ChatWorkspacePane pane, bool active);
@@ -35,6 +37,7 @@ class ChatWorkspace extends StatefulWidget {
required this.controller,
required this.paneBuilder,
this.onFocusPane,
this.onDrop,
this.shortcutsEnabled = true,
this.singlePane = false,
this.mobilePeeks = false,
@@ -71,6 +74,7 @@ class ChatWorkspace extends StatefulWidget {
/// Keyboard navigation only: the owner can focus the target composer.
/// Pointer activation leaves text-selection and pointer focus alone.
final ValueChanged<ChatWorkspacePane>? onFocusPane;
final void Function(ChatWorkspacePane, Object, ChatWorkspaceDropZone)? onDrop;
@override
State<ChatWorkspace> createState() => _ChatWorkspaceState();
@@ -393,6 +397,7 @@ class _ChatWorkspaceState extends State<ChatWorkspace>
sharedEdges,
moveTargets[pane.id],
),
onDrop: widget.onDrop,
);
},
),