From 9b9cc4ca33320eb97c455ece5146513bb046bdaf Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Wed, 28 Oct 2026 04:25:29 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20show=20the=20extend-selection=20shortcut?= =?UTF-8?q?=20as=20Shift=20+=20=E2=86=93=20or=20Shift=20+=20=E2=86=91=20in?= =?UTF-8?q?=20the=20shortcuts=20help?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/__tests__/shortcut-alternatives.test.ts | 22 +++++++++++++++++++++ lib/keyboard-shortcuts/mail.ts | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 lib/__tests__/shortcut-alternatives.test.ts diff --git a/lib/__tests__/shortcut-alternatives.test.ts b/lib/__tests__/shortcut-alternatives.test.ts new file mode 100644 index 000000000..73d202122 --- /dev/null +++ b/lib/__tests__/shortcut-alternatives.test.ts @@ -0,0 +1,22 @@ +import { describe, expect, it } from 'vitest'; +import { SHORTCUT_APPS } from '@/lib/keyboard-shortcuts'; +import { shortcutAlternatives } from '@/lib/shortcut-keys'; + +// The shortcuts help shows " / " as "or" between whole keys. "Shift + ↓ / ↑" +// read as "Shift + ↓ or ↑", which says plain ↑ also extends the selection. + +describe('shortcut alternatives', () => { + it('spell out the modifier in every alternative', () => { + const bad: string[] = []; + for (const app of SHORTCUT_APPS) { + for (const section of app.sections) { + for (const entry of section.entries) { + const alternatives = shortcutAlternatives(entry.key); + const modified = alternatives.some((key) => key.includes(' + ')); + if (modified && alternatives.some((key) => !key.includes(' + '))) bad.push(`${app.id}: ${entry.key}`); + } + } + } + expect(bad).toEqual([]); + }); +}); diff --git a/lib/keyboard-shortcuts/mail.ts b/lib/keyboard-shortcuts/mail.ts index 1ee3eec54..639e5b179 100644 --- a/lib/keyboard-shortcuts/mail.ts +++ b/lib/keyboard-shortcuts/mail.ts @@ -27,7 +27,7 @@ export const MAIL_SHORTCUTS = { { key: "/", description: "shortcuts.global.search" }, { key: "Shift + G", description: "shortcuts.global.refresh" }, { key: "Mod + A", description: "shortcuts.global.select_all" }, - { key: "Shift + ↓ / ↑", description: "shortcuts.global.extend_selection" }, + { key: "Shift + ↓ / Shift + ↑", description: "shortcuts.global.extend_selection" }, ], threads: [ { key: "x", description: "shortcuts.threads.expand_collapse", layout: "default" },