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:
@@ -145,17 +145,18 @@ void main() {
|
||||
expect(harness.opened, ['s3']);
|
||||
});
|
||||
|
||||
testWidgets('add opens the picker; long press removes', (tester) async {
|
||||
testWidgets('add opens the picker; a hold alone removes nothing', (
|
||||
tester,
|
||||
) async {
|
||||
final harness = await _pump(tester);
|
||||
await tester.tap(find.byKey(const Key('chat-stack')));
|
||||
await _settle(tester);
|
||||
// A hold lifts the chat for a drag; let go in place, it settles back.
|
||||
await tester.longPress(find.text('Chat 2'));
|
||||
await _settle(tester);
|
||||
expect(harness.removed, ['s2']);
|
||||
// Removing folds the column, so a snack bar's Undo is in reach.
|
||||
expect(find.byType(ChatStackColumn), findsNothing);
|
||||
await tester.tap(find.byKey(const Key('chat-stack')));
|
||||
await _settle(tester);
|
||||
expect(harness.removed, isEmpty);
|
||||
expect(harness.opened, isEmpty);
|
||||
expect(find.byType(ChatStackColumn), findsOneWidget);
|
||||
await tester.tap(find.byKey(const ValueKey('chat-stack-button-add')));
|
||||
await _settle(tester);
|
||||
expect(harness.added, 1);
|
||||
|
||||
Reference in New Issue
Block a user