diff --git a/app/lib/pages/page_editor.dart b/app/lib/pages/page_editor.dart index c04c5d4782..b8ca9cf81e 100644 --- a/app/lib/pages/page_editor.dart +++ b/app/lib/pages/page_editor.dart @@ -66,6 +66,10 @@ class PageEditor extends HookConsumerWidget { SearchIntent(), SmartSingleActivator(LogicalKeyboardKey.space, control: true): SearchIntent(), + const SingleActivator(LogicalKeyboardKey.keyP, control: true): + const PreviousFocusIntent(), + const SingleActivator(LogicalKeyboardKey.keyN, control: true): + const NextFocusIntent(), }, child: Actions( actions: { diff --git a/app/lib/widgets/components/app/page_search.dart b/app/lib/widgets/components/app/page_search.dart index 5d86f5ba3b..59bca4d5c3 100644 --- a/app/lib/widgets/components/app/page_search.dart +++ b/app/lib/widgets/components/app/page_search.dart @@ -155,7 +155,10 @@ class PageSearchElement extends SearchElement { String get title => page.pageName.formatted; @override - String description(BuildContext context) => page.type.name; + String description(BuildContext context) { + if (page.chapter.isEmpty) return page.type.name; + return "~${page.chapter}"; + } @override Widget icon(BuildContext context) => Icon(page.type.icon); diff --git a/app/lib/widgets/components/app/search_bar.dart b/app/lib/widgets/components/app/search_bar.dart index 9f12d85f15..6fae0ab1bf 100644 --- a/app/lib/widgets/components/app/search_bar.dart +++ b/app/lib/widgets/components/app/search_bar.dart @@ -11,6 +11,7 @@ import "package:text_scroll/text_scroll.dart"; import "package:typewriter/utils/debouncer.dart"; import "package:typewriter/utils/passing_reference.dart"; import "package:typewriter/widgets/components/app/entry_search.dart"; +import "package:typewriter/widgets/components/app/page_search.dart"; import "package:typewriter/widgets/components/general/context_menu_region.dart"; import "package:typewriter/widgets/components/general/decorated_text_field.dart"; import "package:typewriter/widgets/components/general/focused_notifier.dart"; @@ -58,10 +59,13 @@ class SearchNotifier extends StateNotifier { void startGlobalSearch() => asBuilder() ..fetchNewEntry() ..fetchEntry() + ..fetchPage() + ..fetchAddPage() ..open(); void startAddSearch() => asBuilder() ..fetchNewEntry() + ..fetchAddPage() ..open(); void endSearch() {