From 77b92385cbc6eaa17a8a5b18975d74c4e517ddf1 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 16 Dec 2025 19:21:50 +0200 Subject: [PATCH] feat(layout): keyboard shortcut for promoted attributes --- apps/client/src/widgets/layout/NoteTitleActions.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/layout/NoteTitleActions.tsx b/apps/client/src/widgets/layout/NoteTitleActions.tsx index a04bfc242..2e13c5f10 100644 --- a/apps/client/src/widgets/layout/NoteTitleActions.tsx +++ b/apps/client/src/widgets/layout/NoteTitleActions.tsx @@ -1,7 +1,7 @@ import "./NoteTitleActions.css"; import clsx from "clsx"; -import { useEffect, useState } from "preact/hooks"; +import { useEffect, useRef, useState } from "preact/hooks"; import NoteContext from "../../components/note_context"; import FNote from "../../entities/fnote"; @@ -10,7 +10,7 @@ import CollectionProperties from "../note_bars/CollectionProperties"; import { checkFullHeight, getExtendedWidgetType } from "../NoteDetail"; import { PromotedAttributesContent, usePromotedAttributeData } from "../PromotedAttributes"; import Collapsible, { ExternallyControlledCollapsible } from "../react/Collapsible"; -import { useNoteContext, useNoteProperty } from "../react/hooks"; +import { useNoteContext, useNoteProperty, useTriliumEvent } from "../react/hooks"; import SearchDefinitionTab from "../ribbon/SearchDefinitionTab"; export default function NoteTitleActions() { @@ -57,6 +57,9 @@ function PromotedAttributes({ note, componentId, noteContext }: { }); }, [ note, noteContext ]); + // Keyboard shortcut. + useTriliumEvent("toggleRibbonTabPromotedAttributes", () => setExpanded(!expanded)); + if (!cells?.length) return false; return (note && (