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:
@@ -114,31 +114,6 @@ void main() {
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
});
|
||||
|
||||
testWidgets('long press removes a chat, Undo restores it', (tester) async {
|
||||
await _pump(tester, const Size(390, 844));
|
||||
await tester.tap(find.byKey(const Key('chat-row-a')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(_stack);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const ValueKey('chat-stack-button-add')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Gamma').last);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.bySemanticsLabel(chatStackLabel(2)), findsOneWidget);
|
||||
await tester.tap(_stack);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.longPress(find.text('Alpha').last);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Removed Alpha from open chats'), findsOneWidget);
|
||||
expect(find.bySemanticsLabel(chatStackLabel(1)), findsOneWidget);
|
||||
await tester.tap(find.text('Undo'));
|
||||
await tester.pumpAndSettle();
|
||||
// Gamma stays on screen; Alpha is back in the stack.
|
||||
expect(_thread('c').hitTestable(), findsOneWidget);
|
||||
expect(find.bySemanticsLabel(chatStackLabel(2)), findsOneWidget);
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
});
|
||||
|
||||
testWidgets('a wide window keeps its panes and shows no stack', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in New Issue
Block a user