Add Cmd+, shortcut to open Settings

Handle Cmd+, (Ctrl+, on Linux/Windows) in the global keydown handler
to toggle the Settings modal, matching the existing font-size and
Escape shortcuts.
This commit is contained in:
Brandon Oxendine
2026-08-25 17:46:21 +02:00
committed by Rūdolfs Ošiņš
parent cd8c7cac6a
commit 880db5e538
2 changed files with 9 additions and 1 deletions
+5 -1
View File
@@ -18,7 +18,7 @@
import { nodeRunning } from "@app/lib/events";
import { dynamicInterval } from "@app/lib/interval";
import { invoke } from "@app/lib/invoke";
import { hide } from "@app/lib/modal";
import { hide, toggle } from "@app/lib/modal";
import * as router from "@app/lib/router";
import { isLoadedRepoRoute } from "@app/lib/router/definitions";
import {
@@ -35,6 +35,7 @@
theme,
} from "@app/components/ThemeSwitch.svelte";
import GuideView from "@app/modals/Guide.svelte";
import SettingsView from "@app/modals/Settings.svelte";
import Auth from "@app/views/auth/Auth.svelte";
import CreateIdentity from "@app/views/auth/CreateIdentity.svelte";
import InboxView from "@app/views/Inbox.svelte";
@@ -176,6 +177,9 @@
decreaseFontSize();
} else if (auxiliarKey && e.key.toLowerCase() === "0") {
resetFontSize();
} else if (auxiliarKey && e.key === ",") {
e.preventDefault();
toggle({ component: SettingsView, props: {} });
}
}} />
<FullscreenModalPortal />
+4
View File
@@ -73,6 +73,10 @@ export function show<T extends Component<any>>(args: ShowArgs<T>): void {
export function toggle<T extends Component<any>>(args: ShowArgs<T>): void {
const stored = get(modalStore);
if (stored?.disableHide) {
return;
}
if (stored && stored.component === args.component) {
hide();
return;