Host floating chats on the shell window system
Phase 2.3 and 2.4 of docs/plans/floating-windows.md. A floating chat is a window of the chat kind over the app's WindowManager, built from the app-lifetime ChatRuntime, so it shows over every destination and at start without the Chat destination being built. Float and Dock move the same keyed view between the tiling and the window host. The pipelines app keeps one runtime and one ChatWindows; saved chatFloat records (v1 and v2) are brought over once. ChatFloatHost, ChatFloatWindow, the float frames and binding, the controller's float list and FloatingFocusRoot are gone; the workspace only asks whether a chat is out in a window. Every MenuAnchor targets the root overlay (guarded by a test), and menus and tooltips name the Alt chords.
This commit is contained in:
@@ -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 '
|
||||
|
||||
Reference in New Issue
Block a user