Make the terminal's floating mode a window of the window system

Phase 3 of docs/plans/floating-windows.md. The terminal window kind reuses
TerminalHub; TerminalWindows keeps the window in step with TerminalLayout
(show opens or shows it, hide minimises it, Minimise and Close hide the
terminal). The bottom panel stays a shell panel. The first window takes the
frame and maximised state pipelines.terminal-layout.v1 saved.

The terminal's own float chrome and FloatingLayer are deleted.
This commit is contained in:
2026-11-10 22:19:30 +00:00
parent 31f495fc18
commit 75a61dbd8c
15 changed files with 409 additions and 578 deletions
@@ -1,80 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/ui/floating/floating_layer.dart';
void main() {
testWidgets('the layer last pressed or focused paints on top', (
tester,
) async {
tester.view.physicalSize = const Size(800, 600);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final hits = <String>[];
final focus = FocusNode();
addTearDown(focus.dispose);
Widget window(String name, double left, {FocusNode? node}) => Positioned(
left: left,
top: 100,
width: 200,
height: 200,
child: Focus(
focusNode: node,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => hits.add(name),
child: const SizedBox.expand(),
),
),
);
var behind = 0;
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: Stack(
children: [
Positioned.fill(
child: GestureDetector(
onTap: () => behind++,
child: const ColoredBox(color: Colors.white),
),
),
// Nested inside a page, like the chat workspace.
Positioned.fill(
child: FloatingLayer(
coverOverlay: true,
builder: (context, bounds) => [
window('chat', 100, node: focus),
],
),
),
Positioned.fill(
child: FloatingLayer(
builder: (context, bounds) => [window('terminal', 200)],
),
),
],
),
),
),
);
const overlap = Offset(250, 200);
await tester.tapAt(overlap);
expect(hits.last, 'terminal');
await tester.tapAt(const Offset(120, 200));
await tester.pump();
await tester.tapAt(overlap);
expect(hits.last, 'chat');
await tester.tapAt(const Offset(380, 200));
await tester.pump();
await tester.tapAt(overlap);
expect(hits.last, 'terminal');
focus.requestFocus();
await tester.pump();
await tester.pump();
await tester.tapAt(overlap);
expect(hits.last, 'chat');
// Space between windows passes through to the page.
await tester.tapAt(const Offset(700, 500));
expect(behind, 1);
});
}