feat: add keyboard shortcut to open project from task detail (#940)

This commit is contained in:
kolaente
2025-06-16 14:31:02 +02:00
committed by GitHub
parent 56b28400e2
commit 9bab44d5de
3 changed files with 9 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ export interface ShortcutGroup {
shortcuts: Shortcut[] shortcuts: Shortcut[]
} }
export const KEYBOARD_SHORTCUTS : ShortcutGroup[] = [ export const KEYBOARD_SHORTCUTS: ShortcutGroup[] = [
{ {
title: 'keyboardShortcuts.general', title: 'keyboardShortcuts.general',
shortcuts: [ shortcuts: [
@@ -152,6 +152,10 @@ export const KEYBOARD_SHORTCUTS : ShortcutGroup[] = [
title: 'keyboardShortcuts.task.favorite', title: 'keyboardShortcuts.task.favorite',
keys: ['s'], keys: ['s'],
}, },
{
title: 'keyboardShortcuts.task.openProject',
keys: ['u'],
},
{ {
title: 'keyboardShortcuts.task.save', title: 'keyboardShortcuts.task.save',
keys: [ctrl, 's'], keys: [ctrl, 's'],

View File

@@ -1057,6 +1057,7 @@
"delete": "Delete this task", "delete": "Delete this task",
"priority": "Change the priority of this task", "priority": "Change the priority of this task",
"favorite": "Mark this task as favorite / unfavorite", "favorite": "Mark this task as favorite / unfavorite",
"openProject": "Open the project of this task",
"save": "Save the current task" "save": "Save the current task"
}, },
"project": { "project": {

View File

@@ -29,12 +29,14 @@
> >
<a <a
v-if="router.options.history.state.back?.includes('/projects/'+p.id+'/') || false" v-if="router.options.history.state.back?.includes('/projects/'+p.id+'/') || false"
v-shortcut="p.id === project?.id ? 'u' : ''"
@click="router.back()" @click="router.back()"
> >
{{ getProjectTitle(p) }} {{ getProjectTitle(p) }}
</a> </a>
<RouterLink <RouterLink
v-else v-else
v-shortcut="p.id === project?.id ? 'u' : ''"
:to="{ name: 'project.index', params: { projectId: p.id } }" :to="{ name: 'project.index', params: { projectId: p.id } }"
> >
{{ getProjectTitle(p) }} {{ getProjectTitle(p) }}