Skip to content

Build your personal knowledge base with Trilium Notes

feat(client): show the note actions in the quick edit popup

Elian Doranbb97610af9ff
diff --git a/apps/client/src/widgets/dialogs/PopupEditor.spec.tsx b/apps/client/src/widgets/dialogs/PopupEditor.spec.tsx
index 384178d428..404de36cb9 100644
--- a/apps/client/src/widgets/dialogs/PopupEditor.spec.tsx
+++ b/apps/client/src/widgets/dialogs/PopupEditor.spec.tsx
@@ -101,6 +101,7 @@ vi.mock("../react/Modal", () => ({
vi.mock("../NoteDetail", () => ({ default: () => <div className="note-detail-stub" /> }));
vi.mock("../collections/NoteList", () => ({ default: () => null }));
vi.mock("../PromotedAttributes", () => ({ default: () => null }));
+vi.mock("../layout/NoteActions", () => ({ default: () => null }));
vi.mock("../layout/NoteBadges", () => ({ default: () => null }));
vi.mock("../layout/NoteTypeSwitcher", () => ({
default: () => <div className="note-type-switcher-stub" />
diff --git a/apps/client/src/widgets/dialogs/PopupEditor.tsx b/apps/client/src/widgets/dialogs/PopupEditor.tsx
index 8466f0aa6e..8e3c4d3d90 100644
--- a/apps/client/src/widgets/dialogs/PopupEditor.tsx
+++ b/apps/client/src/widgets/dialogs/PopupEditor.tsx
@@ -11,6 +11,7 @@ import tree from "../../services/tree";
import utils from "../../services/utils";
import NoteList from "../collections/NoteList";
import FormattingToolbar from "../layout/FormattingToolbar";
+import NoteActions from "../layout/NoteActions";
import NoteTypeSwitcher from "../layout/NoteTypeSwitcher";
import TitleRow from "../layout/TitleRow";
import NoteDetail from "../NoteDetail";
@@ -147,6 +148,7 @@ export default function PopupEditor() {
<Modal
modalRef={modalRef}
title={<TitleRow />}
+ header={<NoteActions paneButtons={false} />}
customTitleBarButtons={[{
iconClassName: "bx-expand-alt",
title: t("popup-editor.maximize"),
diff --git a/apps/client/src/widgets/layout/NoteActions.css b/apps/client/src/widgets/layout/NoteActions.css
index e3330f3b87..f005f1ddb3 100644
--- a/apps/client/src/widgets/layout/NoteActions.css
+++ b/apps/client/src/widgets/layout/NoteActions.css
@@ -1,4 +1,4 @@
-.title-row > .note-actions-bar {
+.note-actions-bar {
--button-gap: 5px;
display: flex;
diff --git a/apps/client/src/widgets/layout/NoteActions.tsx b/apps/client/src/widgets/layout/NoteActions.tsx
index 87a9fc4ba3..7d019b7a52 100644
--- a/apps/client/src/widgets/layout/NoteActions.tsx
+++ b/apps/client/src/widgets/layout/NoteActions.tsx
@@ -29,15 +29,20 @@ import NoteActionsCustom from "./NoteActionsCustom";
import { useShareState } from "./NoteBadges";
import { NoteTypeDropdownContent } from "./NoteTypeSwitcher";
-export default function NoteActions() {
+export default function NoteActions({ paneButtons = true }: {
+ /** Whether to show the buttons that move, close and create splits, which only a split has. */
+ paneButtons?: boolean;
+}) {
const { note, ntxId, noteContext } = useNoteContext();
return (
<div className="note-actions-bar" style={{ contain: "none" }}>
{note && ntxId && noteContext && <NoteActionsCustom note={note} ntxId={ntxId} noteContext={noteContext} />}
- <MovePaneButton direction="left" />
- <MovePaneButton direction="right" />
- <ClosePaneButton />
- <CreatePaneButton />
+ {paneButtons && <>
+ <MovePaneButton direction="left" />
+ <MovePaneButton direction="right" />
+ <ClosePaneButton />
+ <CreatePaneButton />
+ </>}
{note && note.type !== "launcher" && <NoteContextMenu note={note as FNote} noteContext={noteContext} />}
</div>
);