From 6ae1f070dbc702d4332e8865e9d1b6dbae65a816 Mon Sep 17 00:00:00 2001 From: David Luzar <5153846+dwelle@users.noreply.github.com> Date: Mon, 20 Oct 2025 16:57:40 +0200 Subject: [PATCH] fix: small tweaks to shortcut hints (#10214) --- packages/excalidraw/components/HintViewer.tsx | 21 ++++++++----------- packages/excalidraw/locales/en.json | 9 ++++---- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/packages/excalidraw/components/HintViewer.tsx b/packages/excalidraw/components/HintViewer.tsx index 7eec7cbd58..3d6fb3539c 100644 --- a/packages/excalidraw/components/HintViewer.tsx +++ b/packages/excalidraw/components/HintViewer.tsx @@ -158,11 +158,9 @@ const getHints = ({ !appState.editingTextElement && !appState.selectedLinearElement?.isEditing ) { - return [ - t("hints.deepBoxSelect", { - shortcut: getTaggedShortcutKey("CtrlOrCmd"), - }), - ]; + return t("hints.deepBoxSelect", { + shortcut: getTaggedShortcutKey("CtrlOrCmd"), + }); } if (isGridModeEnabled(app) && appState.selectedElementsAreBeingDragged) { @@ -172,11 +170,10 @@ const getHints = ({ } if (!selectedElements.length && !isMobile) { - return [ - t("hints.canvasPanning", { - shortcut: getTaggedShortcutKey("Space"), - }), - ]; + return t("hints.canvasPanning", { + shortcut_1: getTaggedShortcutKey(t("keys.mmb")), + shortcut_2: getTaggedShortcutKey("Space"), + }); } if (selectedElements.length === 1) { @@ -210,7 +207,7 @@ const getHints = ({ shortcut: getTaggedShortcutKey("Enter"), }); const createFlowchart = t("hints.createFlowchart", { - shortcut: getTaggedShortcutKey("CtrlOrCmd"), + shortcut: getTaggedShortcutKey(["CtrlOrCmd", "↑↓"]), }); if (isFlowchartNodeElement(selectedElements[0])) { if ( @@ -251,7 +248,7 @@ export const HintViewer = ({ } const hint = Array.isArray(hints) - ? hints.map((hint) => hint.replace(/\. ?$/, "")).join(". ") + ? hints.map((hint) => hint.replace(/\. ?$/, "")).join(", ") : hints; const hintJSX = hint.split(/([^<]+<\/kbd>)/g).map((part, index) => { diff --git a/packages/excalidraw/locales/en.json b/packages/excalidraw/locales/en.json index 87895d4fdc..e84eb11d8e 100644 --- a/packages/excalidraw/locales/en.json +++ b/packages/excalidraw/locales/en.json @@ -338,7 +338,7 @@ }, "hints": { "dismissSearch": "{{shortcut}} to dismiss search", - "canvasPanning": "To move canvas, hold mouse wheel or {{shortcut}} while dragging, or use the hand tool", + "canvasPanning": "To move canvas, hold {{shortcut_1}} or {{shortcut_2}} while dragging, or use the hand tool", "linearElement": "Click to start multiple points, drag for single line", "arrowBindModifiers": "Hold Alt to bind inside, or CtrlOrCmd to disable binding", "arrowTool": "Click to start multiple points, drag for single line. Press {{arrowShortcut}} again to change arrow type.", @@ -357,8 +357,8 @@ "lineEditor_pointSelected": "Press {{shortcut_1}} to remove point(s),\n{{shortcut_2}} to duplicate, or drag to move", "lineEditor_nothingSelected": "Select a point to edit (hold {{shortcut_1}} to select multiple),\nor hold {{shortcut_2}} and click to add new points", "publishLibrary": "Publish your own library", - "bindTextToElement": "Press {{shortcut}} to add text", - "createFlowchart": "Hold {{shortcut}} and Arrow key to create a flowchart", + "bindTextToElement": "{{shortcut}} to add text", + "createFlowchart": "{{shortcut}} to create a flowchart", "deepBoxSelect": "Hold {{shortcut}} to deep select, and to prevent dragging", "eraserRevert": "Hold {{shortcut}} to revert the elements marked for deletion", "firefox_clipboard_write": "This feature can likely be enabled by setting the \"dom.events.asyncClipboard.clipboardItem\" flag to \"true\". To change the browser flags in Firefox, visit the \"about:config\" page.", @@ -659,6 +659,7 @@ "enter": "Enter", "shift": "Shift", "spacebar": "Space", - "delete": "Delete" + "delete": "Delete", + "mmb": "Scroll wheel" } }