diff --git a/scripts/steiger-rules.ts b/scripts/steiger-rules.ts
index 8cdf21eeb..57e5028b7 100644
--- a/scripts/steiger-rules.ts
+++ b/scripts/steiger-rules.ts
@@ -478,6 +478,26 @@ const noPropertyPanelInternalsOutsidePanel = createImportRule(
}
)
+const MACOS_MODIFIER_GLYPH_PATTERN = /[⌘⌥⌃]/u
+
+const noHardcodedMacOSShortcutGlyphs = createTextRule(
+ 'open-pencil/no-hardcoded-macos-shortcut-glyphs',
+ (sourceRel, content) => {
+ if (!sourceRel.endsWith('.vue')) return []
+ const diagnostics: Array<{ message: string; line?: number; column?: number }> = []
+ for (const match of content.matchAll(MACOS_MODIFIER_GLYPH_PATTERN)) {
+ const before = content.slice(0, match.index)
+ const lines = before.split('\n')
+ diagnostics.push({
+ message: 'Use formatShortcut() instead of hardcoding macOS-only modifier glyphs.',
+ line: lines.length,
+ column: lines.at(-1)?.length ?? 0
+ })
+ }
+ return diagnostics
+ }
+)
+
const SHORTCUT_LABEL_PATTERN = /(?:Shift|Ctrl|Alt|Option|Cmd|Command|⌘|⇧|⌥|⌃)\s*[+)\w]/u
const noShortcutTextInLabels = createTextRule(
@@ -546,6 +566,7 @@ export const openPencilArchitecturePlugin = {
noAppImportsInSharedUi,
noPropertyPanelInternalsOutsidePanel,
noShortcutTextInLabels,
+ noHardcodedMacOSShortcutGlyphs,
noUiImportsInCore
]
}
diff --git a/src/components/ZoomDropdown.vue b/src/components/ZoomDropdown.vue
index ffbc1386c..b23b3c224 100644
--- a/src/components/ZoomDropdown.vue
+++ b/src/components/ZoomDropdown.vue
@@ -9,7 +9,7 @@ import {
} from 'reka-ui'
import { nextTick, ref, watch } from 'vue'
-import { useEditorCommands, useI18n } from '@open-pencil/vue'
+import { useEditorCommands, useI18n, formatShortcut } from '@open-pencil/vue'
import { menuItem, useMenuUI } from '@/components/ui/menu'
import { useEditorStore } from '@/app/editor/active-store'
@@ -69,7 +69,7 @@ function zoomOut() {
const ZOOM_PRESETS: ReadonlyArray<{ label: string; level: number; shortcut?: string }> = [
{ label: '50%', level: 0.5 },
- { label: '100%', level: 1, shortcut: '⌘0' },
+ { label: '100%', level: 1, shortcut: 'MOD+0' },
{ label: '200%', level: 2 }
]
@@ -126,15 +126,15 @@ watch(open, (v) => {