Focus floating chat from terminal shortcut
Raise the most recently used chat when Ctrl+Y is invoked from another window, then rely on the existing host lifecycle to focus its composer. Preserve toggle behavior while chat is active and retain the Apple shortcut aliases.
This commit is contained in:
@@ -232,7 +232,7 @@ void main() {
|
||||
});
|
||||
|
||||
testWidgets(
|
||||
'on macOS Ctrl+Y in a terminal stays with it; Cmd+Y and Option+Y toggle',
|
||||
'on macOS Ctrl+Y from a terminal raises chat; Cmd+Y and Option+Y toggle',
|
||||
(tester) async {
|
||||
await wide(tester);
|
||||
final typing = FocusNode();
|
||||
@@ -256,12 +256,12 @@ void main() {
|
||||
typing.requestFocus();
|
||||
await tester.pump();
|
||||
await _chord(tester, LogicalKeyboardKey.controlLeft);
|
||||
expect(h.manager.groupShown(chatWindowKind), isTrue);
|
||||
expect(typed, contains(LogicalKeyboardKey.keyY));
|
||||
await _chord(tester, LogicalKeyboardKey.metaLeft);
|
||||
expect(h.manager.groupShown(chatWindowKind), isFalse);
|
||||
await _chord(tester);
|
||||
expect(typed, isNot(contains(LogicalKeyboardKey.keyY)));
|
||||
await _chord(tester, LogicalKeyboardKey.metaLeft);
|
||||
expect(h.manager.groupShown(chatWindowKind), isTrue);
|
||||
await _chord(tester);
|
||||
expect(h.manager.groupShown(chatWindowKind), isFalse);
|
||||
},
|
||||
variant: const TargetPlatformVariant({TargetPlatform.macOS}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user