Add keyboard navigation to search results
Keep the search field focused while selecting results with Control or arrow keys, and open the selected result with Enter. Document the field-scoped shortcuts and cover navigation, reset, submission, and typing behavior with regression tests.
This commit is contained in:
@@ -30,6 +30,7 @@ const _implemented = [
|
||||
'Resize the terminal panel',
|
||||
'Open a chat list item',
|
||||
'Resize a list pane',
|
||||
'Move through Search results',
|
||||
'Previous or next artifact or changed file',
|
||||
];
|
||||
|
||||
@@ -130,6 +131,18 @@ void main() {
|
||||
expect(actions, isNot(contains('Move between terminal tabs')));
|
||||
});
|
||||
|
||||
test('Search documents field-scoped Control navigation', () {
|
||||
final registry = KeyboardShortcutRegistry(
|
||||
platform: TargetPlatform.macOS,
|
||||
web: true,
|
||||
);
|
||||
final entry = _entry(registry, 'Move through Search results');
|
||||
expect(entry.group, KeyboardShortcutGroup.search);
|
||||
expect(entry.keys, 'Ctrl+N, Ctrl+P, Up, Down');
|
||||
expect(entry.caveat, contains('Search field'));
|
||||
expect(entry.caveat, contains('Control rather than Cmd'));
|
||||
});
|
||||
|
||||
testWidgets('groups stack in one column with their keys right-aligned', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in New Issue
Block a user