refactor(shortcuts): update v-shortcut values to event.code format
Change all shortcut strings from character-based format to event.code format: - Single letters: 't' -> 'KeyT', 's' -> 'KeyS', etc. - Sequences: 'g o' -> 'KeyG KeyO', etc. - Modifiers: 'Mod+e' -> 'Mod+KeyE', 'Shift+?' -> 'Shift+Slash' - edit-shortcut prop: 'e' -> 'KeyE' Shortcuts like 'Escape' and 'Shift+Delete' remain unchanged as their event.code values are identical.
This commit is contained in:
parent
8dc6e77ba0
commit
f2901deb00
|
|
@ -59,7 +59,7 @@
|
|||
</Modal>
|
||||
|
||||
<BaseButton
|
||||
v-shortcut="'Shift+?'"
|
||||
v-shortcut="'Shift+Slash'"
|
||||
class="keyboard-shortcuts-button d-print-none"
|
||||
@click="showKeyboardShortcuts()"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<BaseButton
|
||||
v-shortcut="'Mod+e'"
|
||||
v-shortcut="'Mod+KeyE'"
|
||||
class="menu-show-button"
|
||||
:title="$t('keyboardShortcuts.toggleMenu')"
|
||||
:aria-label="menuActive ? $t('misc.hideMenu') : $t('misc.showMenu')"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<menu class="menu-list other-menu-items">
|
||||
<li>
|
||||
<RouterLink
|
||||
v-shortcut="'g o'"
|
||||
v-shortcut="'KeyG KeyO'"
|
||||
:to="{ name: 'home'}"
|
||||
>
|
||||
<span class="menu-item-icon icon">
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<RouterLink
|
||||
v-shortcut="'g u'"
|
||||
v-shortcut="'KeyG KeyU'"
|
||||
:to="{ name: 'tasks.range'}"
|
||||
>
|
||||
<span class="menu-item-icon icon">
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<RouterLink
|
||||
v-shortcut="'g p'"
|
||||
v-shortcut="'KeyG KeyP'"
|
||||
:to="{ name: 'projects.index'}"
|
||||
>
|
||||
<span class="menu-item-icon icon">
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<RouterLink
|
||||
v-shortcut="'g a'"
|
||||
v-shortcut="'KeyG KeyA'"
|
||||
:to="{ name: 'labels.index'}"
|
||||
>
|
||||
<span class="menu-item-icon icon">
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<RouterLink
|
||||
v-shortcut="'g m'"
|
||||
v-shortcut="'KeyG KeyM'"
|
||||
:to="{ name: 'teams.index'}"
|
||||
>
|
||||
<span class="menu-item-icon icon">
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
:upload-callback="uploadCallback"
|
||||
:placeholder="$t('task.description.placeholder')"
|
||||
:show-save="true"
|
||||
edit-shortcut="e"
|
||||
edit-shortcut="KeyE"
|
||||
:enable-discard-shortcut="true"
|
||||
:enable-mentions="true"
|
||||
:mention-project-id="modelValue.projectId"
|
||||
|
|
|
|||
|
|
@ -38,14 +38,14 @@
|
|||
>
|
||||
<a
|
||||
v-if="router.options.history.state?.back?.includes('/projects/'+p.id+'/') || false"
|
||||
v-shortcut="p.id === project?.id ? 'u' : ''"
|
||||
v-shortcut="p.id === project?.id ? 'KeyU' : ''"
|
||||
@click="router.back()"
|
||||
>
|
||||
{{ getProjectTitle(p) }}
|
||||
</a>
|
||||
<RouterLink
|
||||
v-else
|
||||
v-shortcut="p.id === project?.id ? 'u' : ''"
|
||||
v-shortcut="p.id === project?.id ? 'KeyU' : ''"
|
||||
:to="{ name: 'project.index', params: { projectId: p.id } }"
|
||||
>
|
||||
{{ getProjectTitle(p) }}
|
||||
|
|
@ -423,7 +423,7 @@
|
|||
>
|
||||
<template v-if="canWrite">
|
||||
<XButton
|
||||
v-shortcut="'t'"
|
||||
v-shortcut="'KeyT'"
|
||||
:class="{'is-pending': !task.done}"
|
||||
class="button--mark-done"
|
||||
icon="check-double"
|
||||
|
|
@ -439,7 +439,7 @@
|
|||
@update:modelValue="sub => task.subscription = sub"
|
||||
/>
|
||||
<XButton
|
||||
v-shortcut="'s'"
|
||||
v-shortcut="'KeyS'"
|
||||
variant="secondary"
|
||||
:icon="task.isFavorite ? 'star' : ['far', 'star']"
|
||||
@click="toggleFavorite"
|
||||
|
|
@ -452,7 +452,7 @@
|
|||
<span class="action-heading">{{ $t('task.detail.organization') }}</span>
|
||||
|
||||
<XButton
|
||||
v-shortcut="'l'"
|
||||
v-shortcut="'KeyL'"
|
||||
variant="secondary"
|
||||
icon="tags"
|
||||
@click="setFieldActive('labels')"
|
||||
|
|
@ -460,7 +460,7 @@
|
|||
{{ $t('task.detail.actions.label') }}
|
||||
</XButton>
|
||||
<XButton
|
||||
v-shortcut="'p'"
|
||||
v-shortcut="'KeyP'"
|
||||
variant="secondary"
|
||||
icon="exclamation-circle"
|
||||
@click="setFieldActive('priority')"
|
||||
|
|
@ -475,7 +475,7 @@
|
|||
{{ $t('task.detail.actions.percentDone') }}
|
||||
</XButton>
|
||||
<XButton
|
||||
v-shortcut="'c'"
|
||||
v-shortcut="'KeyC'"
|
||||
variant="secondary"
|
||||
icon="fill-drip"
|
||||
:icon-color="color"
|
||||
|
|
@ -487,7 +487,7 @@
|
|||
<span class="action-heading">{{ $t('task.detail.management') }}</span>
|
||||
|
||||
<XButton
|
||||
v-shortcut="'a'"
|
||||
v-shortcut="'KeyA'"
|
||||
v-cy="'taskDetail.assign'"
|
||||
variant="secondary"
|
||||
icon="users"
|
||||
|
|
@ -496,7 +496,7 @@
|
|||
{{ $t('task.detail.actions.assign') }}
|
||||
</XButton>
|
||||
<XButton
|
||||
v-shortcut="'f'"
|
||||
v-shortcut="'KeyF'"
|
||||
variant="secondary"
|
||||
icon="paperclip"
|
||||
@click="openAttachments()"
|
||||
|
|
@ -504,7 +504,7 @@
|
|||
{{ $t('task.detail.actions.attachments') }}
|
||||
</XButton>
|
||||
<XButton
|
||||
v-shortcut="'r'"
|
||||
v-shortcut="'KeyR'"
|
||||
variant="secondary"
|
||||
icon="sitemap"
|
||||
@click="setRelatedTasksActive()"
|
||||
|
|
@ -512,7 +512,7 @@
|
|||
{{ $t('task.detail.actions.relatedTasks') }}
|
||||
</XButton>
|
||||
<XButton
|
||||
v-shortcut="'m'"
|
||||
v-shortcut="'KeyM'"
|
||||
variant="secondary"
|
||||
icon="list"
|
||||
@click="setFieldActive('moveProject')"
|
||||
|
|
@ -523,7 +523,7 @@
|
|||
<span class="action-heading">{{ $t('task.detail.dateAndTime') }}</span>
|
||||
|
||||
<XButton
|
||||
v-shortcut="'d'"
|
||||
v-shortcut="'KeyD'"
|
||||
variant="secondary"
|
||||
icon="calendar"
|
||||
@click="setFieldActive('dueDate')"
|
||||
|
|
@ -719,7 +719,7 @@ const lastProjectOrTaskProject = computed(() => lastProject.value ?? project.val
|
|||
|
||||
// Use Shift+R on macOS (Alt+R produces special characters depending on keyboard layout)
|
||||
// Use Alt+r on other platforms
|
||||
const reminderShortcut = computed(() => isAppleDevice() ? 'Shift+R' : 'Alt+r')
|
||||
const reminderShortcut = computed(() => isAppleDevice() ? 'Shift+KeyR' : 'Alt+KeyR')
|
||||
|
||||
onBeforeRouteLeave(async () => {
|
||||
if (taskNotFound.value) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue