fix: name the account sign out leaves in the command palette, add star, hide dead key hints

This commit is contained in:
Linus Rath
2026-11-04 05:09:09 +01:00
parent f44be446bb
commit 551b5ce4fa
5 changed files with 94 additions and 5 deletions
+9
View File
@@ -10,3 +10,12 @@ import { useSettingsStore } from "@/stores/settings-store";
export function isSingleKeyShortcutOff(event: Pick<KeyboardEvent, "key" | "ctrlKey" | "metaKey" | "altKey">): boolean {
return isSingleCharacterKey(event) && useSettingsStore.getState().singleKeyShortcuts === false;
}
/**
* A key hint as the help and menus write it ("r", "Shift + I", "#") that's a single-key
* shortcut, so it does nothing while those are off. Arrows aren't characters.
*/
export function isSingleKeyHint(combo: string): boolean {
const key = combo.replace(/^(shift\s*\+\s*)+/i, "").trim();
return [...key].length === 1 && !/[←→↑↓]/.test(key);
}