Rebind chat file and center-stage shortcuts
Give Cmd/Ctrl+E to the active chat Files panel while preserving terminal behavior, and move Center Stage to the shifted chord. Update shortcut documentation and regression coverage for the new bindings.
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:pipelines_app/features/chat/screen.dart';
|
||||
import 'package:pipelines_app/shell/adaptive_shell.dart';
|
||||
import 'package:pipelines_app/shell/destination.dart';
|
||||
import 'package:pipelines_app/features/chat/conversation/chat_thread_view.dart';
|
||||
import 'package:pipelines_app/features/chat/files/files_panel.dart';
|
||||
import 'package:pipelines_app/features/chat/ui/sessions/session_actions.dart';
|
||||
import 'package:pipelines_app/features/chat/workspace/chat_workspace.dart';
|
||||
|
||||
@@ -18,10 +19,23 @@ class _Gateway extends FakeChatGateway {
|
||||
if (type == 'chat_sessions') {
|
||||
return Future.value({
|
||||
'chat_sessions': [
|
||||
for (final id in ['a', 'b', 'c']) {'id': id, 'title': 'Chat $id'},
|
||||
for (final id in ['a', 'b', 'c'])
|
||||
{'id': id, 'title': 'Chat $id', 'directory': '/home/$id'},
|
||||
],
|
||||
});
|
||||
}
|
||||
if (type == 'directory_listing') {
|
||||
final path = '${fields['path'] ?? '/home/a'}';
|
||||
return Future.value({
|
||||
'directory_listing': {
|
||||
'path': path,
|
||||
'home': '/home/a',
|
||||
'entries': [
|
||||
{'name': 'notes.md', 'path': '$path/notes.md'},
|
||||
],
|
||||
},
|
||||
});
|
||||
}
|
||||
if (type == 'chat_shells') return Future.value({'chat_shells': []});
|
||||
return super.call(type, fields);
|
||||
}
|
||||
@@ -248,6 +262,41 @@ void main() {
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('Ctrl+E opens and closes Files and restores composer focus', (
|
||||
tester,
|
||||
) async {
|
||||
await _setup(tester);
|
||||
final composer = _input('a');
|
||||
await tester.tap(composer);
|
||||
await tester.sendKeyDownEvent(LogicalKeyboardKey.controlLeft);
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.keyE);
|
||||
await tester.sendKeyUpEvent(LogicalKeyboardKey.controlLeft);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byType(FilesPanel), findsOneWidget);
|
||||
final filter = find.descendant(
|
||||
of: find.byType(FilesPanel),
|
||||
matching: find.byType(EditableText),
|
||||
);
|
||||
expect(filter, findsOneWidget);
|
||||
expect(
|
||||
tester.widget<EditableText>(filter).focusNode.hasPrimaryFocus,
|
||||
isTrue,
|
||||
);
|
||||
|
||||
await tester.sendKeyDownEvent(LogicalKeyboardKey.controlLeft);
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.keyE);
|
||||
await tester.sendKeyUpEvent(LogicalKeyboardKey.controlLeft);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(FilesPanel), findsNothing);
|
||||
await tester.pump(const Duration(milliseconds: 50));
|
||||
expect(
|
||||
tester.widget<EditableText>(composer).focusNode.hasPrimaryFocus,
|
||||
isTrue,
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets(
|
||||
'drag compacts and expands sidebar without losing panes or drafts',
|
||||
(tester) async {
|
||||
|
||||
Reference in New Issue
Block a user