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/shortcut hints: update the shortcut hints for image notes
Adorian Dorandca0e8a72a18
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex dabe89c8e4..7ba7082989 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -999,10 +999,15 @@"image_viewer": {"loading_error": "There was an error loading the image.","hints": {- "title": "Zoom & Pan",+ "zoom": "Zoom","zoom_in": "Zoom in","zoom_out": "Zoom out",+ "reset_zoom": "Reset zoom","pan": "Pan",+ "pan_up": "Up",+ "pan_down": "Down",+ "pan_left": "Left",+ "pan_right": "Right","pan_fast": "Faster panning","navigation": "Navigation","next_image": "Next image",diff --git a/apps/client/src/widgets/react/ImageViewer.spec.tsx b/apps/client/src/widgets/react/ImageViewer.spec.tsxindex 46fa87bb49..edb21e05bb 100644--- a/apps/client/src/widgets/react/ImageViewer.spec.tsx+++ b/apps/client/src/widgets/react/ImageViewer.spec.tsx@@ -66,14 +66,20 @@ describe("ImageViewer", () => {));const sections = collectShortcutHints(host);- expect(sections).toHaveLength(2);+ expect(sections).toHaveLength(3);expect(sections[0].hints.map(h => h.labelKey)).toEqual(["image_viewer.hints.zoom_in","image_viewer.hints.zoom_out",- "image_viewer.hints.pan",- "image_viewer.hints.pan_fast"+ "image_viewer.hints.reset_zoom"]);expect(sections[1].hints.map(h => h.labelKey)).toEqual([+ "image_viewer.hints.pan_up",+ "image_viewer.hints.pan_down",+ "image_viewer.hints.pan_left",+ "image_viewer.hints.pan_right",+ "image_viewer.hints.pan_fast"+ ]);+ expect(sections[2].hints.map(h => h.labelKey)).toEqual(["image_viewer.hints.next_image","image_viewer.hints.previous_image","image_viewer.hints.first_image",diff --git a/apps/client/src/widgets/react/ImageViewer.tsx b/apps/client/src/widgets/react/ImageViewer.tsxindex ea71ecf38e..0fb7b0c385 100644--- a/apps/client/src/widgets/react/ImageViewer.tsx+++ b/apps/client/src/widgets/react/ImageViewer.tsx@@ -32,11 +32,20 @@ const REVEAL_FALLBACK_MS = 1000;const IMAGE_VIEWER_HINTS: ShortcutHintDefinition = [{- titleKey: "image_viewer.hints.title",+ titleKey: "image_viewer.hints.zoom",hints: [{ keys: ["Ctrl++", "E"], labelKey: "image_viewer.hints.zoom_in" },{ keys: ["Ctrl+-", "Q"], labelKey: "image_viewer.hints.zoom_out" },- { keys: ["W", "A", "S", "D", "Up", "Down", "Left", "Right"], labelKey: "image_viewer.hints.pan" },+ { keys: ["/", "Numpad /"], labelKey: "image_viewer.hints.reset_zoom" }+ ]+ },+ {+ titleKey: "image_viewer.hints.pan",+ hints: [+ { keys: ["Up", "W"], labelKey: "image_viewer.hints.pan_up" },+ { keys: ["Down", "S"], labelKey: "image_viewer.hints.pan_down" },+ { keys: ["Left", "A"], labelKey: "image_viewer.hints.pan_left" },+ { keys: ["Right", "D"], labelKey: "image_viewer.hints.pan_right" },{ keys: ["Shift"], labelKey: "image_viewer.hints.pan_fast" }]},