Make floating-window close buttons minimise

Remove the separate minimise control and make the title-bar X hide windows while preserving their state and reachability. Update window behavior documentation and focused tests for chat, terminal, and window layering.
This commit is contained in:
2026-11-12 01:45:42 +00:00
parent 2330f50268
commit e4f3ebdcab
12 changed files with 123 additions and 43 deletions
@@ -390,19 +390,24 @@ void main() {
await app.stop(tester);
});
testWidgets('X closes the window and returns nothing to the tiling', (
tester,
) async {
testWidgets('X minimises the window: the chat stays open, returns nothing '
'to the tiling, and the chord brings the window back', (tester) async {
await _saved('a', 'b');
final app = _App(_Store());
await app.start(tester);
await _menu(tester, 'b', 'Float (Alt+Y)');
await tester.tap(find.byTooltip('Close'));
await tester.tap(find.byTooltip('Minimise'));
await tester.pumpAndSettle();
expect(app.floating, isEmpty);
// Still a window, hidden; not closed and not docked.
expect(app.floating, ['b']);
expect(app.windows.windows.single.minimized, isTrue);
expect(_shown('Chat b'), findsNothing);
expect(_workspace(tester).panes.map((p) => p.sessionId), ['a']);
expect(_thread('b'), findsNothing);
expect(app.gateway.calls.where((c) => c.type == 'chat_close'), isEmpty);
await _chord(tester);
expect(_shown('Chat b'), findsOneWidget);
expect(_thread('b').hitTestable(), findsOneWidget);
expect(app.floating, ['b']);
await app.stop(tester);
});
@@ -167,10 +167,12 @@ void main() {
expect(floatFinder, findsOneWidget);
expect(frame().size, start.size + const Offset(80, 50));
await tester.tap(find.byTooltip('Close'));
// The X minimises too: the window stays listed, hidden, with its shells.
await tester.tap(find.byTooltip('Minimise'));
await tester.pumpAndSettle();
expect(layout.visible, isFalse);
expect(manager.windows, isEmpty);
expect(manager.windows.single.minimized, isTrue);
expect(floatFinder, findsNothing);
expect(hub.tabs, hasLength(2));
await ctrlBacktick(tester);
expect(floatFinder, findsOneWidget);