From 0e2955b57e6d152cebc7d44ef91db8d0a074c0c3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 4 Feb 2026 21:06:20 +0200 Subject: [PATCH] feat(mobile/search): group search buttons into split --- .../src/stylesheets/theme-next/pages.css | 8 +- .../widgets/ribbon/SearchDefinitionTab.tsx | 95 ++++++++++--------- 2 files changed, 56 insertions(+), 47 deletions(-) diff --git a/apps/client/src/stylesheets/theme-next/pages.css b/apps/client/src/stylesheets/theme-next/pages.css index e6125e80e2..a5041cd553 100644 --- a/apps/client/src/stylesheets/theme-next/pages.css +++ b/apps/client/src/stylesheets/theme-next/pages.css @@ -57,12 +57,12 @@ height: 18px; } -/* +/* * SEARCH PAGE */ /* Button bar */ - .search-definition-widget .search-setting-table tbody:last-child div { + .search-definition-widget .search-setting-table .search-actions-container { justify-content: flex-end; gap: 8px; } @@ -143,7 +143,7 @@ /* * OPTIONS PAGES */ - + :root { --options-card-min-width: 500px; --options-card-max-width: 900px; @@ -335,4 +335,4 @@ nav.options-section-tabs + .options-section { .etapi-options-section div { height: auto !important; -} \ No newline at end of file +} diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index c3a54566a7..78694ce57f 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -15,7 +15,7 @@ import tree from "../../services/tree"; import { getErrorMessage, isMobile } from "../../services/utils"; import ws from "../../services/ws"; import RenameNoteBulkAction from "../bulk_actions/note/rename_note"; -import Button from "../react/Button"; +import Button, { SplitButton } from "../react/Button"; import Dropdown from "../react/Dropdown"; import { FormListHeader, FormListItem } from "../react/FormList"; import { useTriliumEvent } from "../react/hooks"; @@ -129,48 +129,7 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: Pick - - - -
-
- - - + )} @@ -178,6 +137,56 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: Pick("special-notes/save-search-note", { searchNoteId: note.noteId }); + if (!notePath) return; + + await ws.waitForMaxKnownEntityChangeId(); + await appContext.tabManager.getActiveContext()?.setNote(notePath); + + // Note the {{- notePathTitle}} in json file is not typo, it's unescaping + // See https://www.i18next.com/translation-function/interpolation#unescape + toast.showMessage(t("search_definition.search_note_saved", { notePathTitle: await tree.getNotePathTitle(notePath) })); + } + + return ( + + + + +