feat(shortcuts): Add Ctrl/Cmd+1..4 to switch main views
Add keyboard shortcuts (Ctrl/Cmd + 1–4) to jump to the four main views: Dashboard, Repositories, Pull Requests and Issues & Boards. - Handler runs in the capture phase so editors/dialogs can still trap keys. - Switching is blocked when the app is busy or any modal/overlay is open; repeats and combinations with Alt/Shift are ignored. - When switching to the repository view the shortcut selects an existing repo tab (it will not open a native file dialog if no repo is available). Also update tab button titles to surface the shortcuts and add entries to the help overlay (English and German).
This commit is contained in:
@@ -89,10 +89,10 @@
|
||||
|
||||
<header class="workspace-navigation">
|
||||
<nav class="global-navigation" aria-label={language === "de" ? "Hauptnavigation" : "Main navigation"}>
|
||||
<button type="button" class:active={activeView === "management"} aria-current={activeView === "management" ? "page" : undefined} disabled={isBusy} onclick={onOpenManagement}><House size={17}/><span>Dashboard</span></button>
|
||||
<button type="button" class:active={activeView === "repository"} aria-current={activeView === "repository" ? "page" : undefined} disabled={isBusy} onclick={onOpenRepositories}><Database size={17}/><span>Repositories</span></button>
|
||||
<button type="button" class:active={activeView === "review-center"} aria-current={activeView === "review-center" ? "page" : undefined} disabled={isBusy} onclick={onOpenReviewCenter}><GitPullRequest size={17}/><span>Pull Requests</span></button>
|
||||
<button type="button" class:active={activeView === "issues"} aria-current={activeView === "issues" ? "page" : undefined} disabled={isBusy} onclick={onOpenIssues}><Columns3 size={17}/><span>Issues & Boards</span></button>
|
||||
<button type="button" class:active={activeView === "management"} aria-current={activeView === "management" ? "page" : undefined} disabled={isBusy} onclick={onOpenManagement} title="Dashboard (Ctrl + 1)"><House size={17}/><span>Dashboard</span></button>
|
||||
<button type="button" class:active={activeView === "repository"} aria-current={activeView === "repository" ? "page" : undefined} disabled={isBusy} onclick={onOpenRepositories} title="Repositories (Ctrl + 2)"><Database size={17}/><span>Repositories</span></button>
|
||||
<button type="button" class:active={activeView === "review-center"} aria-current={activeView === "review-center" ? "page" : undefined} disabled={isBusy} onclick={onOpenReviewCenter} title="Pull Requests (Ctrl + 3)"><GitPullRequest size={17}/><span>Pull Requests</span></button>
|
||||
<button type="button" class:active={activeView === "issues"} aria-current={activeView === "issues" ? "page" : undefined} disabled={isBusy} onclick={onOpenIssues} title="Issues & Boards (Ctrl + 4)"><Columns3 size={17}/><span>Issues & Boards</span></button>
|
||||
</nav>
|
||||
{#if activeView === "repository"}
|
||||
<div class="repository-row">
|
||||
|
||||
@@ -249,6 +249,7 @@
|
||||
summary: "Die Hilfe ist überall erreichbar. Dialoge lassen sich konsistent schließen und Suchfelder direkt fokussieren.",
|
||||
commands: [
|
||||
{ command: "Ctrl + /", description: "Diese Hilfe öffnen" },
|
||||
{ command: "Ctrl + 1 … 4", description: "Zwischen Dashboard, Repositories, Pull Requests und Issues & Boards wechseln" },
|
||||
{ command: "Ctrl + A", description: "Alle Dateien in der aktiven Statusliste („Ungestaged“ oder „Gestaged“) auswählen" },
|
||||
{ command: "Escape", description: "Aktuelles Overlay oder Dialogfenster schließen – in der Statusliste die aktuelle Auswahl aufheben" },
|
||||
{ command: "Tab / Shift + Tab", description: "Zwischen Bedienelementen wechseln" },
|
||||
@@ -460,6 +461,7 @@
|
||||
summary: "Help is available everywhere. Dialogs close consistently and search fields receive focus automatically.",
|
||||
commands: [
|
||||
{ command: "Ctrl + /", description: "Open this help center" },
|
||||
{ command: "Ctrl + 1 … 4", description: "Switch between Dashboard, Repositories, Pull Requests and Issues & Boards" },
|
||||
{ command: "Ctrl + A", description: "Select every file in the focused status list (Unstaged or Staged)" },
|
||||
{ command: "Escape", description: "Close the current overlay or dialog – in the status list, clear the current selection" },
|
||||
{ command: "Tab / Shift + Tab", description: "Move between controls" },
|
||||
|
||||
Reference in New Issue
Block a user