From dc503560003fcf97a5233cc19f001c3508746b93 Mon Sep 17 00:00:00 2001 From: zipg Date: Mon, 6 Jul 2026 12:48:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Windows=20=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E9=94=AE=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=20(#2599?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: staff --- .../editor/EditorSettingsDialog.vue | 8 +-- .../editor/keyboardShortcuts.spec.ts | 19 +++++++ .../__tests__/editor/shortcutDisplay.spec.ts | 15 ++++++ .../__tests__/editor/shortcutRegistry.spec.ts | 11 ++++- .../src/lib/editor/keyboardShortcuts.ts | 7 ++- .../desktop/src/lib/editor/shortcutDisplay.ts | 49 ++++++++++++++++--- .../src/lib/editor/shortcutRegistry.ts | 10 ++-- 7 files changed, 102 insertions(+), 17 deletions(-) create mode 100644 apps/desktop/src/lib/__tests__/editor/keyboardShortcuts.spec.ts diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index b3b8a607d2..9d715acd03 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -2350,8 +2350,8 @@ onUnmounted(cleanupPreviewEditor); readonly :aria-invalid="shortcutConflicts.includes(definition.id)" :placeholder="t('settings.shortcutPressShortcut')" - class="h-7 w-auto min-w-12 max-w-32 shrink-0 cursor-default rounded-[6px] border border-transparent bg-background px-2.5 text-center font-mono text-[13px] font-semibold text-foreground/75 shadow-inner outline-none selection:bg-transparent placeholder:text-muted-foreground aria-invalid:border-destructive/70 aria-invalid:text-destructive aria-invalid:ring-destructive/20" - :class="editingShortcutId === definition.id ? 'max-w-44 cursor-text border-border/80 bg-background text-left text-foreground shadow-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/35' : ''" + class="h-7 w-auto min-w-12 max-w-64 shrink-0 cursor-default rounded-[6px] border border-transparent bg-background px-2.5 text-center font-mono text-[13px] font-semibold text-foreground/75 shadow-inner outline-none selection:bg-transparent placeholder:text-muted-foreground aria-invalid:border-destructive/70 aria-invalid:text-destructive aria-invalid:ring-destructive/20" + :class="editingShortcutId === definition.id ? 'max-w-64 cursor-text border-border/80 bg-background text-left text-foreground shadow-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/35' : ''" @keydown="(event: KeyboardEvent) => onShortcutKeydown(definition.id, event)" />