Add unified keyboard shortcut help
Expose platform-aware shortcut help from Settings, keep narrow layouts scrollable, share Search tooltip labels, and document Terminal-to-chat composer focus. Integrate together with the separately reviewed Alt-slash handler.
This commit is contained in:
@@ -10,6 +10,7 @@ import 'list_detail.dart';
|
||||
import 'list_pane_widths.dart';
|
||||
import 'shell_bar.dart';
|
||||
import 'shell_list_shortcuts.dart';
|
||||
import 'shell_search_shortcut_labels.dart';
|
||||
import 'tab_history.dart';
|
||||
import '../ui/input/keyboard_owner.dart';
|
||||
|
||||
@@ -383,7 +384,7 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
IconButton(
|
||||
key: const ValueKey('shell.search'),
|
||||
onPressed: onSearch,
|
||||
tooltip: 'Search',
|
||||
tooltip: 'Search (${shellSearchShortcutLabels().join(', ')})',
|
||||
icon: const Icon(Icons.search),
|
||||
),
|
||||
...widget.barActions,
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
/// Search chords supported by the shell, independent of theme overrides.
|
||||
List<String> shellSearchShortcutLabels([TargetPlatform? platform]) {
|
||||
final target = platform ?? defaultTargetPlatform;
|
||||
final apple = target == TargetPlatform.macOS || target == TargetPlatform.iOS;
|
||||
return [
|
||||
apple ? 'Option+/' : 'Alt+/',
|
||||
if (target == TargetPlatform.macOS) 'Cmd+/',
|
||||
'Ctrl+/',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user