Chat stack: hold and drag to reorder the open chats, or onto x to remove

A 300 ms hold lifts a chat in the open column; dragging opens a gap and
dropping commits through ChatWorkspaceController.movePane, the pane order
the server syncs. An x comes in at the bottom while dragging; dropping on
it removes the chat with Undo, which restores its place. Escape, a
cancelled pointer or a drop away from the column put it back. Move up,
Move down and Remove are semantic actions. Repaint-only motion; reduced
motion swaps at once. Also keep floating-layout tracking out of
initState, and let the capture kit hold a press before a drag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 21:17:51 +00:00
parent f8e4d78466
commit fba3b924f1
20 changed files with 1573 additions and 254 deletions
@@ -20,6 +20,7 @@ class ChatStackFab extends StatefulWidget {
required this.onOpen,
required this.onAdd,
this.onRemove,
this.onReorder,
});
/// The open chats in their synced order; one is [ChatStackEntry.current].
@@ -30,6 +31,10 @@ class ChatStackFab extends StatefulWidget {
final ValueChanged<BuildContext> onAdd;
final ValueChanged<ChatStackEntry>? onRemove;
/// Moves a chat to an index of the open-chat order (a drag in the open
/// column, or its Move up and Move down actions).
final void Function(ChatStackEntry entry, int index)? onReorder;
@override
State<ChatStackFab> createState() => ChatStackFabState();
}
@@ -216,6 +221,7 @@ class ChatStackFabState extends State<ChatStackFab>
onAdd: _add,
onDismiss: collapse,
onRemove: canRemove ? _remove : null,
onReorder: widget.onReorder,
);
},
child: AnimatedOpacity(