fix: show the extend-selection shortcut as Shift + ↓ or Shift + ↑ in the shortcuts help

This commit is contained in:
Linus Rath
2026-10-28 04:25:29 +01:00
parent 1de1d02f57
commit 9b9cc4ca33
2 changed files with 23 additions and 1 deletions
@@ -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([]);
});
});
+1 -1
View File
@@ -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" },