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
@@ -84,6 +84,37 @@ void main() {
expect(controller.panes.last.sessionId, 'new-two');
});
test('drop replaces, splits and moves without duplicating a chat', () {
final controller = ChatWorkspaceController()
..open('one')
..splitActive('two', ChatSplitAxis.horizontal);
addTearDown(controller.dispose);
final first = controller.panes.first;
final second = controller.panes.last;
controller.dropSession('three', first.id, ChatWorkspaceDropZone.replace);
expect(controller.panes.map((pane) => pane.sessionId), ['three', 'two']);
controller.dropSession('four', second.id, ChatWorkspaceDropZone.right);
expect(controller.panes.map((pane) => pane.sessionId), [
'three',
'two',
'four',
]);
expect(
controller.panes.where((pane) => pane.sessionId == 'three'),
hasLength(1),
);
final four = controller.panes.last;
controller.dropSession('three', four.id, ChatWorkspaceDropZone.bottom);
expect(
controller.panes.where((pane) => pane.sessionId == 'three'),
hasLength(1),
);
expect(controller.activePane?.sessionId, 'three');
});
test(
'geometry clamps visible sizes but retains ratios and spatial neighbors',
() {