Float several chats and keep them working on every tab

Floating chats were stuck on other destinations: the hidden Chat tab
muted the window's hide animation, so the window stayed painted but took
no input. The reveal now uses its own ticker, each floating pane's focus
scope hangs from a FloatingFocusRoot above the destination stack, and the
windows show over every destination like the terminal.

Any number of chats can float; the shortcut, a window's X and the menu
show or hide them together. Each pane keeps its own frame (also while
docked), saved in record version 2; version 1 records still load. Drags
read the live frame so fast pointer events no longer lose movement.
This commit is contained in:
2026-11-10 15:26:38 +00:00
parent 827d9bd3b5
commit cdd54c113c
25 changed files with 962 additions and 419 deletions
@@ -76,34 +76,36 @@ void main() {
expect(_opacity(tester), 1);
});
testWidgets('desktop shows it on hover and focus, and keeps semantics', (
tester,
) async {
final semantics = tester.ensureSemantics();
await tester.pumpWidget(_host(48));
expect(_opacity(tester), 0);
// Hidden, it is still reachable by a screen reader.
expect(
tester.getSemantics(_copy),
isSemantics(tooltip: 'Copy', isButton: true, isFocusable: true),
);
testWidgets(
'desktop shows it on hover and focus, and keeps semantics',
(tester) async {
final semantics = tester.ensureSemantics();
await tester.pumpWidget(_host(48));
expect(_opacity(tester), 0);
// Hidden, it is still reachable by a screen reader.
expect(
tester.getSemantics(_copy),
isSemantics(tooltip: 'Copy', isButton: true, isFocusable: true),
);
final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
addTearDown(mouse.removePointer);
await mouse.addPointer(location: Offset.zero);
await mouse.moveTo(tester.getCenter(find.text('The answer text')));
await tester.pumpAndSettle();
expect(_opacity(tester), 1);
await mouse.moveTo(const Offset(5, 590));
await tester.pumpAndSettle();
expect(_opacity(tester), 0);
final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
addTearDown(mouse.removePointer);
await mouse.addPointer(location: Offset.zero);
await mouse.moveTo(tester.getCenter(find.text('The answer text')));
await tester.pumpAndSettle();
expect(_opacity(tester), 1);
await mouse.moveTo(const Offset(5, 590));
await tester.pumpAndSettle();
expect(_opacity(tester), 0);
// Keyboard focus reveals it too.
await tester.sendKeyEvent(LogicalKeyboardKey.tab);
await tester.pumpAndSettle();
expect(_opacity(tester), 1);
semantics.dispose();
}, variant: TargetPlatformVariant.only(TargetPlatform.macOS));
// Keyboard focus reveals it too.
await tester.sendKeyEvent(LogicalKeyboardKey.tab);
await tester.pumpAndSettle();
expect(_opacity(tester), 1);
semantics.dispose();
},
variant: TargetPlatformVariant.only(TargetPlatform.macOS),
);
for (final (width, inGutter) in [(1400.0, true), (560.0, false)]) {
testWidgets('a ${width.toInt()} px conversation puts Copy '