From d1ae2db587a70064f3bf882f6f4f35ed6e5671bb Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Mon, 15 Dec 2025 00:31:36 +0200 Subject: [PATCH 1/7] client/status bar/note paths: replace the "Clone note to new location" button with a link --- apps/client/src/widgets/react/LinkButton.tsx | 16 ++++++++++------ apps/client/src/widgets/ribbon/NotePathsTab.tsx | 7 ++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/apps/client/src/widgets/react/LinkButton.tsx b/apps/client/src/widgets/react/LinkButton.tsx index a9596c972..81e2943a1 100644 --- a/apps/client/src/widgets/react/LinkButton.tsx +++ b/apps/client/src/widgets/react/LinkButton.tsx @@ -1,16 +1,20 @@ import { ComponentChild } from "preact"; +import { CommandNames } from "../../components/app_context"; interface LinkButtonProps { - onClick: () => void; + onClick?: () => void; text: ComponentChild; + triggerCommand?: CommandNames; } -export default function LinkButton({ onClick, text }: LinkButtonProps) { +export default function LinkButton({ onClick, text, triggerCommand }: LinkButtonProps) { return ( - { - e.preventDefault(); - onClick(); - }}> + { + e.preventDefault(); + if (onClick) onClick(); + }}> {text} ) diff --git a/apps/client/src/widgets/ribbon/NotePathsTab.tsx b/apps/client/src/widgets/ribbon/NotePathsTab.tsx index d639a8928..18d5086d6 100644 --- a/apps/client/src/widgets/ribbon/NotePathsTab.tsx +++ b/apps/client/src/widgets/ribbon/NotePathsTab.tsx @@ -3,11 +3,12 @@ import { useEffect, useMemo, useState } from "preact/hooks"; import FNote, { NotePathRecord } from "../../entities/fnote"; import { t } from "../../services/i18n"; import { NOTE_PATH_TITLE_SEPARATOR } from "../../services/tree"; -import Button from "../react/Button"; import { useTriliumEvent } from "../react/hooks"; import NoteLink from "../react/NoteLink"; import { joinElements } from "../react/react_utils"; import { TabContext } from "./ribbon-interface"; +import LinkButton from "../react/LinkButton"; + export default function NotePathsTab({ note, hoistedNoteId, notePath }: TabContext) { const sortedNotePaths = useSortedNotePaths(note, hoistedNoteId); @@ -35,9 +36,9 @@ export function NotePathsWidget({ sortedNotePaths, currentNotePath }: { )) : undefined} -