From 1850528ced1634c52842e1a37d304a5157fe7a36 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 11 Nov 2026 19:51:15 +0000 Subject: [PATCH] Cover Alt slash search focus Update the keyboard focus regression coverage so Alt+/ is verified as the shell Search destination shortcut while preserving the existing Ctrl+/ behavior. Record the expanded focused-check result in the implementation note. --- app/notes/open-search-alt-slash.md | 5 +++-- .../features/chat/chat_keyboard_focus_test.dart | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/notes/open-search-alt-slash.md b/app/notes/open-search-alt-slash.md index 33729489..d81858a6 100644 --- a/app/notes/open-search-alt-slash.md +++ b/app/notes/open-search-alt-slash.md @@ -7,8 +7,9 @@ - Search destination routing, focus, query retention, and composer drafts were left unchanged. - Focused checks: `tool/memwatch/full.sh 'test/shell/search_shortcuts_test.dart - test/shell/destination_shortcuts_test.dart test/shell/list_shortcuts_test.dart'` - — PASS (10 passed, 0 failed, 0 skipped). + test/shell/destination_shortcuts_test.dart test/shell/list_shortcuts_test.dart + test/features/chat/chat_keyboard_focus_test.dart'` — PASS (13 passed, 0 + failed, 0 skipped). - `tool/analyze.sh` — clean. - Browser capture was not run in this implementation stage; UI review owns full-app Alt+/ and Meta+/ interaction evidence. diff --git a/app/test/features/chat/chat_keyboard_focus_test.dart b/app/test/features/chat/chat_keyboard_focus_test.dart index f5fbbce2..7532bb0f 100644 --- a/app/test/features/chat/chat_keyboard_focus_test.dart +++ b/app/test/features/chat/chat_keyboard_focus_test.dart @@ -5,6 +5,8 @@ import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/features/chat/screen.dart'; import 'package:pipelines_app/features/chat/ui/sessions/session_actions.dart'; import 'package:pipelines_app/features/chat/workspace/chat_workspace.dart'; +import 'package:pipelines_app/features/search/search_screen.dart'; +import 'package:pipelines_app/features/search/ui/search_bar_controls.dart'; import 'package:pipelines_app/shell/adaptive_shell.dart'; import 'package:pipelines_app/shell/destination.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -51,6 +53,11 @@ Future _setup(WidgetTester tester) async { destination: AppDestination.chat, destinationBodies: { AppDestination.chat: (_) => ChatScreen(gateway: gateway), + AppDestination.search: (_) => SearchScreen( + gateway: gateway, + onOpen: (_) {}, + embedded: true, + ), }, ), ), @@ -104,8 +111,8 @@ void main() { expect(await _slash(tester), isFalse); expect(_editable(tester, 'a').focusNode.hasPrimaryFocus, isTrue); - // Shift+/ (a question mark) and Alt+/ are not the shortcut; Ctrl+/ is - // the shell's own Search chord. + // Shift+/ (a question mark) is not the shortcut. Alt+/ opens the Search + // destination, while Ctrl+/ remains the shell's own Search chord. await _focusSidebar(tester); await tester.sendKeyDownEvent(LogicalKeyboardKey.shiftLeft); await tester.sendKeyEvent(LogicalKeyboardKey.slash, character: '?'); @@ -114,7 +121,11 @@ void main() { await tester.sendKeyEvent(LogicalKeyboardKey.slash); await tester.sendKeyUpEvent(LogicalKeyboardKey.altLeft); await tester.pumpAndSettle(); - expect(_editable(tester, 'a').focusNode.hasPrimaryFocus, isFalse); + expect(find.byKey(searchFieldKey), findsOneWidget); + expect( + tester.widget(find.byKey(searchFieldKey)).focusNode!.hasFocus, + isTrue, + ); await tester.pumpWidget(const SizedBox.shrink()); });