Add the shell window host with layering acceptance tests

Phase 1.3 and 1.4 of docs/plans/floating-windows.md. Windows are plain
children of the terminal stage's stack in the shell page, outside every
destination, so popups opened from one are above all of them. Each window
has its own page navigator: pushed pages open inside the window, and popup
routes go to the root navigator. One WindowFrame chrome (move, resize,
minimise, maximise, close), a focus scope per window, a ScaffoldMessenger
per window.

No feature uses it yet. The capture fixture opens probe windows with
?windows=N, and window_layering_test.dart covers every popup type from a
window over Chat and over another destination.
This commit is contained in:
2026-11-10 20:48:31 +00:00
parent 215e1cee2a
commit a99f7014f5
20 changed files with 1666 additions and 16 deletions
@@ -21,6 +21,7 @@ class TerminalStage extends StatelessWidget {
required this.reveal,
required this.focus,
required this.child,
this.windows,
});
final TerminalHub hub;
@@ -31,6 +32,10 @@ class TerminalStage extends StatelessWidget {
final FocusScopeNode focus;
final Widget child;
/// The app's floating windows, above the app and the panel in this one
/// stack. It takes no input between windows.
final Widget? windows;
static final Tween<double> _fade = Tween<double>(begin: 0.4, end: 1);
@override
@@ -102,6 +107,7 @@ class TerminalStage extends StatelessWidget {
],
),
),
if (windows != null) Positioned.fill(child: windows!),
],
);
},
@@ -33,6 +33,7 @@ class TerminalSurface extends StatefulWidget {
required this.cupertino,
required this.child,
this.shortcutHere = true,
this.windows,
});
final TerminalHub hub;
@@ -44,6 +45,9 @@ class TerminalSurface extends StatefulWidget {
/// terminal (the app shows it on Chat only).
final bool shortcutHere;
/// The app's floating windows (see [TerminalStage.windows]).
final Widget? windows;
@override
State<TerminalSurface> createState() => _TerminalSurfaceState();
}
@@ -228,6 +232,7 @@ class _TerminalSurfaceState extends State<TerminalSurface>
present: !_narrow && (widget.layout.visible || !_reveal.isDismissed),
reveal: _curve,
focus: _focus.scope,
windows: widget.windows,
child: _withShortcut(child!),
),
child: widget.child,