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
client/right pane: update tooltip
Adorian Doran393d9d970d42
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex 6fc2d1195d..399a6e0709 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -2713,6 +2713,8 @@"empty_message": "Nothing to show for this note","empty_button": "Hide the panel","toggle": "Toggle right panel",+ "peek": "Peek right pane",+ "hide": "Hide right pane","dock": "Dock panel","close": "Close panel","custom_widget_go_to_source": "Go to source code"diff --git a/apps/client/src/widgets/sidebar/RightPaneToggleHandle.tsx b/apps/client/src/widgets/sidebar/RightPaneToggleHandle.tsxindex 22db778654..f6b8da0c37 100644--- a/apps/client/src/widgets/sidebar/RightPaneToggleHandle.tsx+++ b/apps/client/src/widgets/sidebar/RightPaneToggleHandle.tsx@@ -40,14 +40,15 @@ export default function RightPaneToggleHandle({ rightPaneVisible, onToggle }: Ri// The `distance` (second value) keeps the tooltip clear of the handle so it can't// overlap it and cause hover flicker.const tooltipConfig = useMemo(() => ({- title: t("right_pane.toggle"),+ // Open: a click hides it. Closed: a click peeks it (the transient overlay; the pin docks it).+ title: rightPaneVisible ? t("right_pane.hide") : t("right_pane.peek"),placement: "left" as const,offset: () => {const rect = buttonRef.current?.getBoundingClientRect();if (!rect || pointerY.current === null) return [ 0, TOOLTIP_MARGIN_PX ] as [number, number];return [ pointerY.current - (rect.top + rect.height / 2), TOOLTIP_MARGIN_PX ] as [number, number];}- }), []);+ }), [ rightPaneVisible ]);useStaticTooltip(buttonRef, tooltipConfig);return (