From 998a16ab8792c6d2cccccbbac937ad93d1330fd8 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 16 Dec 2025 18:59:36 +0200 Subject: [PATCH] feat(layout): keyboard shortcut for note paths --- apps/client/src/widgets/layout/StatusBar.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/layout/StatusBar.tsx b/apps/client/src/widgets/layout/StatusBar.tsx index cc20931d1..00a57b573 100644 --- a/apps/client/src/widgets/layout/StatusBar.tsx +++ b/apps/client/src/widgets/layout/StatusBar.tsx @@ -1,6 +1,6 @@ import "./StatusBar.css"; -import { Locale } from "@triliumnext/commons"; +import { KeyboardActionNames, Locale } from "@triliumnext/commons"; import { Dropdown as BootstrapDropdown } from "bootstrap"; import clsx from "clsx"; import { type ComponentChildren } from "preact"; @@ -381,12 +381,18 @@ function AttributesPane({ note, noteContext, attributesShown, setAttributesShown //#region Note paths function NotePaths({ note, hoistedNoteId, notePath }: StatusBarContext) { + const dropdownRef = useRef(null); const sortedNotePaths = useSortedNotePaths(note, hoistedNoteId); const count = sortedNotePaths?.length ?? 0; + const enabled = count > 1; - return (count > 1 && + // Keyboard shortcut. + useTriliumEvent("toggleRibbonTabNotePaths", () => enabled && dropdownRef.current?.show()); + + return (enabled &&