Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(client): show similar notes in the connections tab
Elian Doranf1839b897a29
diff --git a/apps/client/src/widgets/sidebar/RightPanelContainer.tsx b/apps/client/src/widgets/sidebar/RightPanelContainer.tsxindex 29e9720267..6ea6a821eb 100644--- a/apps/client/src/widgets/sidebar/RightPanelContainer.tsx+++ b/apps/client/src/widgets/sidebar/RightPanelContainer.tsx@@ -31,6 +31,7 @@ import PdfPages from "./pdf/PdfPages";import RightPanelWidget, { CollapsibleWidgets } from "./RightPanelWidget";import RightPanePeekButton from "./RightPanePeekButton";import RightPaneTabs, { RIGHT_PANE_TABS, RightPaneTabDefinition, RightPaneTabId } from "./RightPaneTabs";+import SimilarNotes from "./SimilarNotes";import TableOfContents from "./TableOfContents";const MIN_WIDTH_PERCENT = 5;@@ -198,6 +199,11 @@ function useItems(rightPaneVisible: boolean, widgetsByParent: WidgetsByParent):enabled: !!note,tab: "connections"},+ {+ el: <SimilarNotes />,+ enabled: !!note,+ tab: "connections"+ },{el: <TableOfContents />,enabled: (noteType === "text" || noteType === "doc" || isPdf || noteType === "llmChat" || !!note?.isMarkdown()),diff --git a/apps/client/src/widgets/sidebar/SimilarNotes.tsx b/apps/client/src/widgets/sidebar/SimilarNotes.tsxnew file mode 100644index 0000000000..b5f9f1cd87--- /dev/null+++ b/apps/client/src/widgets/sidebar/SimilarNotes.tsx@@ -0,0 +1,16 @@+import { t } from "../../services/i18n";+import { useActiveNoteContext } from "../react/hooks";+// The list itself is shared with the ribbon's similar notes tab and the status bar's+// bottom panel; only the framing differs here.+import SimilarNotesTab from "../ribbon/SimilarNotesTab";+import RightPanelWidget from "./RightPanelWidget";++export default function SimilarNotes() {+ const { note } = useActiveNoteContext();++ return (+ <RightPanelWidget id="similarNotes" title={t("similar_notes.title")}>+ {note && <SimilarNotesTab note={note} />}+ </RightPanelWidget>+ );+}