Add global shortcuts for opening Chat
Allow Ctrl+K and Alt+K to switch to Chat from any destination, while preserving terminal Ctrl+K behavior and focusing the active composer. Register the shortcuts in help and cover matching, navigation, terminal handling, and composer focus with regression tests.
This commit is contained in:
@@ -23,6 +23,23 @@ void main() {
|
||||
expect(search.caveat, contains('browser'));
|
||||
});
|
||||
|
||||
test(
|
||||
'Open Chat lists Option+K or Alt+K with Ctrl+K and the terminal rule',
|
||||
() {
|
||||
KeyboardShortcutEntry openChat(TargetPlatform platform) =>
|
||||
KeyboardShortcutRegistry(
|
||||
platform: platform,
|
||||
web: false,
|
||||
).entries.firstWhere((entry) => entry.action == 'Open Chat');
|
||||
|
||||
expect(openChat(TargetPlatform.macOS).keys, 'Option+K, Ctrl+K');
|
||||
final linux = openChat(TargetPlatform.linux);
|
||||
expect(linux.keys, 'Alt+K, Ctrl+K');
|
||||
expect(linux.caveat, contains('kill-line'));
|
||||
expect(openChat(TargetPlatform.windows).keys, 'Alt+K, Ctrl+K');
|
||||
},
|
||||
);
|
||||
|
||||
test('uses the shell primary modifier rule on iOS', () {
|
||||
final entries = const KeyboardShortcutRegistry(
|
||||
platform: TargetPlatform.iOS,
|
||||
|
||||
Reference in New Issue
Block a user