Shortcut to commit page

This commit enhances the display of command descriptions in the Command Palette by splitting the descriptions into separate tokens. This provides a more readable and organized presentation of the information. Additionally, a new keyboard shortcut has been added for easy navigation to the commit page of a project.

Changes:
- Split command descriptions into separate tokens in CmdK.svelte
- Add 'Shift+c' keyboard shortcut for accessing the commit page of a project in CommandPalette.svelte
This commit is contained in:
Ian Donahue 2023-03-27 20:22:45 +02:00 committed by Nikita Galaiko
parent 8c4adf4d6b
commit 2c76b6185b
2 changed files with 10 additions and 1 deletions

View File

@ -257,7 +257,9 @@
<svelte:component this={command.icon} />
</span>
<span class="quick-command flex-grow">{command.title}</span>
<span class="quick-command-key">{command.description}</span>
{#each command.description.split(' ') as token}
<span class="quick-command-key">{token}</span>
{/each}
</div>
{/if}
{/if}

View File

@ -8,6 +8,7 @@
import Replay from './Replay.svelte';
import Branch from './Branch.svelte';
import { currentProject } from '$lib/current_project';
import { goto } from '$app/navigation';
let dialog: ComponentType | undefined;
@ -54,6 +55,12 @@
dialog === Commit ? (dialog = undefined) : (dialog = Commit);
}
},
'Shift+c': () => {
if ($currentProject) {
goto(`/projects/${$currentProject?.id}/commit`);
}
},
r: () => {
if ($currentProject) {
dialog === Replay ? (dialog = undefined) : (dialog = Replay);