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): add empty connections tab to right pane
Elian Doran960261e95e18
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex f444cd26eb..5c6920924d 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -3238,6 +3238,7 @@"custom_widget_go_to_source": "Go to source code","tab_outline": "Outline","tab_attributes": "Attributes",+ "tab_connections": "Connections","tab_chat": "AI chat","tab_widgets": "Widgets"},diff --git a/apps/client/src/widgets/sidebar/RightPaneTabs.tsx b/apps/client/src/widgets/sidebar/RightPaneTabs.tsxindex 813d1e9257..c60dfcf17e 100644--- a/apps/client/src/widgets/sidebar/RightPaneTabs.tsx+++ b/apps/client/src/widgets/sidebar/RightPaneTabs.tsx@@ -6,7 +6,7 @@ import { useRef } from "preact/hooks";import { t } from "../../services/i18n";import { useStaticTooltip } from "../react/hooks";-export type RightPaneTabId = "outline" | "attributes" | "chat" | "widgets";+export type RightPaneTabId = "outline" | "attributes" | "connections" | "chat" | "widgets";export interface RightPaneTabDefinition {id: RightPaneTabId;@@ -31,6 +31,9 @@ export const RIGHT_PANE_TABS: RightPaneTabDefinition[] = [// an image has neither. It stays put through all of them.{ id: "outline", title: t("right_pane.tab_outline"), icon: "bx bx-list-ul", alwaysShown: true },{ id: "attributes", title: t("right_pane.tab_attributes"), icon: "bx bx-hash" },+ // How the note relates to the others. Empty for now (its widgets are yet to come), so it leans on+ // alwaysShown to appear in the strip at all; any note can be linked to, so staying put fits it anyway.+ { id: "connections", title: t("right_pane.tab_connections"), icon: "bx bx-network-chart", alwaysShown: true },{ id: "chat", title: t("right_pane.tab_chat"), icon: "bx bx-bot" },// Widgets contributed by the user's own scripts, which belong to none of the groups above.{ id: "widgets", title: t("right_pane.tab_widgets"), icon: "bx bx-extension" }diff --git a/apps/client/src/widgets/sidebar/RightPanelContainer.spec.tsx b/apps/client/src/widgets/sidebar/RightPanelContainer.spec.tsxindex fc9f6a61eb..ce77ff2438 100644--- a/apps/client/src/widgets/sidebar/RightPanelContainer.spec.tsx+++ b/apps/client/src/widgets/sidebar/RightPanelContainer.spec.tsx@@ -33,10 +33,11 @@ describe("groupIntoTabs", () => {const attributes = widget("attributes");const tabs = groupIntoTabs([ attributes, widget("outline", { enabled: false }) ], true);- // The outline is the tab that asks; the chat and the widgets go as they did.- expect(tabs.map((tab) => tab.id)).toEqual([ "outline", "attributes" ]);+ // The outline and the connections are the tabs that ask; the chat and the widgets go as they did.+ expect(tabs.map((tab) => tab.id)).toEqual([ "outline", "attributes", "connections" ]);expect(tabs[0].items).toEqual([]);expect(tabs[1].items).toEqual([ attributes.el ]);+ expect(tabs[2].items).toEqual([]);});});