Skip to content

Commit caa0761

Browse files
committed
Add configurable zoom shortcuts
1 parent fd9216e commit caa0761

14 files changed

Lines changed: 70 additions & 23 deletions

File tree

apps/desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zennotes/desktop",
33
"productName": "ZenNotes",
4-
"version": "1.1.6",
4+
"version": "1.1.7",
55
"description": "ZenNotes desktop shell",
66
"private": true,
77
"main": "./out/main/index.js",

apps/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zennotes/server",
33
"private": true,
4-
"version": "1.1.6",
4+
"version": "1.1.7",
55
"scripts": {
66
"dev": "node ../../tooling/scripts/run-go-server-dev.mjs",
77
"prepare-web": "node ../../tooling/scripts/prepare-server-web-dist.mjs",

apps/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zennotes/web",
33
"private": true,
4-
"version": "1.1.6",
4+
"version": "1.1.7",
55
"type": "module",
66
"description": "ZenNotes web client for self-hosted and hosted deployments",
77
"homepage": "https://zennotes.org",

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "zennotes-monorepo",
33
"private": true,
4-
"version": "1.1.6",
4+
"version": "1.1.7",
55
"description": "ZenNotes monorepo for desktop, web, and self-hosted server builds",
66
"packageManager": "npm@10.9.2",
77
"engines": {

packages/app-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zennotes/app-core",
33
"private": true,
4-
"version": "1.1.6",
4+
"version": "1.1.7",
55
"type": "module",
66
"exports": {
77
"./main": "./src/main.tsx"

packages/app-core/src/App.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,21 @@ function App(): JSX.Element {
220220
void state.exportActiveNotePdf()
221221
return
222222
}
223+
if (matchesShortcut(e, overrides, 'global.zoomIn')) {
224+
e.preventDefault()
225+
void window.zen.zoomInApp()
226+
return
227+
}
228+
if (matchesShortcut(e, overrides, 'global.zoomOut')) {
229+
e.preventDefault()
230+
void window.zen.zoomOutApp()
231+
return
232+
}
233+
if (matchesShortcut(e, overrides, 'global.zoomReset')) {
234+
e.preventDefault()
235+
void window.zen.resetAppZoom()
236+
return
237+
}
223238
if (matchesShortcut(e, overrides, 'global.searchNotes')) {
224239
// ⌘P — note search
225240
e.preventDefault()

packages/app-core/src/components/HelpView.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ function resolveShortcutKeys(
5252
if (action === 'Toggle connections') return shortcut(overrides, 'global.toggleConnections')
5353
if (action === 'Toggle Zen mode') return shortcut(overrides, 'global.toggleZenMode')
5454
if (action === 'Close active tab') return shortcut(overrides, 'global.closeActiveTab')
55-
if (action === 'Zoom in') return 'Mod+='
56-
if (action === 'Zoom out') return 'Mod+-'
57-
if (action === 'Reset zoom') return 'Mod+0'
55+
if (action === 'Export note as PDF') return shortcut(overrides, 'global.exportNotePdf')
56+
if (action === 'Zoom in') return shortcut(overrides, 'global.zoomIn')
57+
if (action === 'Zoom out') return shortcut(overrides, 'global.zoomOut')
58+
if (action === 'Reset zoom') return shortcut(overrides, 'global.zoomReset')
5859
if (action === 'Toggle word wrap') return shortcut(overrides, 'global.toggleWordWrap')
5960
}
6061

packages/app-core/src/lib/commands.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ export function buildCommands(options?: { includeUnavailable?: boolean }): Comma
469469
id: 'view.zoom.in',
470470
title: 'Zoom In',
471471
category: 'View',
472-
shortcut: 'Mod+=',
472+
shortcut: shortcut('global.zoomIn'),
473473
keywords: 'bigger larger scale ui app browser',
474474
run: async () => {
475475
await window.zen.zoomInApp()
@@ -479,7 +479,7 @@ export function buildCommands(options?: { includeUnavailable?: boolean }): Comma
479479
id: 'view.zoom.out',
480480
title: 'Zoom Out',
481481
category: 'View',
482-
shortcut: 'Mod+-',
482+
shortcut: shortcut('global.zoomOut'),
483483
keywords: 'smaller decrease scale ui app browser',
484484
run: async () => {
485485
await window.zen.zoomOutApp()
@@ -489,7 +489,7 @@ export function buildCommands(options?: { includeUnavailable?: boolean }): Comma
489489
id: 'view.zoom.reset',
490490
title: 'Reset Zoom',
491491
category: 'View',
492-
shortcut: 'Mod+0',
492+
shortcut: shortcut('global.zoomReset'),
493493
keywords: 'actual size normal reset scale ui app browser',
494494
run: async () => {
495495
await window.zen.resetAppZoom()

packages/app-core/src/lib/help.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ export const HELP_SHORTCUT_SECTIONS: HelpShortcutSection[] = [
226226
{ keys: 'Mod+2', action: 'Toggle connections', detail: 'Toggle the connections panel for the active editor pane.' },
227227
{ keys: 'Mod+.', action: 'Toggle Zen mode', detail: 'Hide or restore the app chrome so only the active editor, preview, or split view stays on screen.' },
228228
{ keys: 'Mod+W', action: 'Close active tab', detail: 'Close the current note or virtual tab.' },
229+
{ keys: 'Shift+Mod+E', action: 'Export note as PDF', detail: 'Export the active note as a PDF file.' },
229230
{ keys: 'Mod+=', action: 'Zoom in', detail: 'Scale the whole app up, including chrome, editor, and preview.' },
230231
{ keys: 'Mod+-', action: 'Zoom out', detail: 'Scale the whole app down when the UI feels too large.' },
231232
{ keys: 'Mod+0', action: 'Reset zoom', detail: 'Return the app to its default scale.' },

0 commit comments

Comments
 (0)