Skip to content

Build your personal knowledge base with Trilium Notes

client/right pane: add keyboard shortcut support to peek the right pane

Adorian Doran30b7e6b32786
diff --git a/apps/client/src/components/app_context.ts b/apps/client/src/components/app_context.ts
index 02a0c2d8ad..c93f0312a3 100644
--- a/apps/client/src/components/app_context.ts
+++ b/apps/client/src/components/app_context.ts
@@ -353,6 +353,7 @@ export type CommandMappings = {
toggleRibbonTabNotePaths: CommandData;
toggleRibbonTabSimilarNotes: CommandData;
toggleRightPane: CommandData;
+ peekRightPane: CommandData;
printActiveNote: CommandData;
exportAsPdf: CommandData;
showPrintPreview: PrintPreviewData;
diff --git a/apps/client/src/widgets/sidebar/RightPanelContainer.tsx b/apps/client/src/widgets/sidebar/RightPanelContainer.tsx
index e555006d8f..785046b910 100644
--- a/apps/client/src/widgets/sidebar/RightPanelContainer.tsx
+++ b/apps/client/src/widgets/sidebar/RightPanelContainer.tsx
@@ -74,6 +74,8 @@ export default function RightPanelContainer({ widgetsByParent }: { widgetsByPare
// Legacy entry points (tab-row toggle, empty-state button) open/close the *docked* pane.
useTriliumEvent("toggleRightPane", useCallback(() => apply("toggleDocked"), [ apply ]));
+ // Keyboard shortcut: peek the pane as an overlay (same as clicking the handle).
+ useTriliumEvent("peekRightPane", useCallback(() => apply("toggleOverlay"), [ apply ]));
useOverlayDismiss(mode === "overlay", close);
diff --git a/apps/server/src/assets/translations/en/server.json b/apps/server/src/assets/translations/en/server.json
index 24f66bd8f7..652374d81c 100644
--- a/apps/server/src/assets/translations/en/server.json
+++ b/apps/server/src/assets/translations/en/server.json
@@ -53,6 +53,7 @@
"toggle-link-map": "Toggle Link Map",
"other": "Other",
"toggle-right-pane": "Toggle the display of the right pane, which includes Table of Contents and Highlights",
+ "peek-right-pane": "Peek the right pane as a temporary overlay that floats over the content and closes when it loses focus",
"open-note-externally": "Open note as a file with default application",
"render-active-note": "Render (re-render) active note",
"run-active-note": "Run active JavaScript (frontend/backend) code note",
@@ -148,6 +149,7 @@
"toggle-ribbon-tab-note-paths": "Toggle Ribbon Tab Note Paths",
"toggle-ribbon-tab-similar-notes": "Toggle Ribbon Tab Similar Notes",
"toggle-right-pane": "Toggle Right Pane",
+ "peek-right-pane": "Peek Right Pane",
"print-active-note": "Print Active Note",
"export-active-note-as-pdf": "Export Active Note as PDF",
"open-note-externally": "Open Note Externally",
diff --git a/packages/commons/src/lib/keyboard_actions_interface.ts b/packages/commons/src/lib/keyboard_actions_interface.ts
index 37fda72180..81f1f3855c 100644
--- a/packages/commons/src/lib/keyboard_actions_interface.ts
+++ b/packages/commons/src/lib/keyboard_actions_interface.ts
@@ -79,6 +79,7 @@ const enum KeyboardActionNamesEnum {
toggleRibbonTabNotePaths,
toggleRibbonTabSimilarNotes,
toggleRightPane,
+ peekRightPane,
printActiveNote,
exportAsPdf,
openNoteExternally,
diff --git a/packages/trilium-core/src/services/keyboard_actions.ts b/packages/trilium-core/src/services/keyboard_actions.ts
index 397d34759f..19a3b486b4 100644
--- a/packages/trilium-core/src/services/keyboard_actions.ts
+++ b/packages/trilium-core/src/services/keyboard_actions.ts
@@ -662,11 +662,19 @@ function getDefaultKeyboardActions() {
{
actionName: "toggleRightPane",
friendlyName: t("keyboard_action_names.toggle-right-pane"),
- iconClass: "bx bx-dock-right",
+ iconClass: "bx bx-sidebar bx-flip-horizontal",
defaultShortcuts: [],
description: t("keyboard_actions.toggle-right-pane"),
scope: "window"
},
+ {
+ actionName: "peekRightPane",
+ friendlyName: t("keyboard_action_names.peek-right-pane"),
+ iconClass: "bx bx-sidebar bx-flip-horizontal",
+ defaultShortcuts: [],
+ description: t("keyboard_actions.peek-right-pane"),
+ scope: "window"
+ },
{
actionName: "printActiveNote",
friendlyName: t("keyboard_action_names.print-active-note"),