feat(ui): improve keyboard shortcuts discoverability and centralized management

This commit is contained in:
Tiberiu Ichim 2026-02-22 08:18:50 +02:00
parent b581b4f86c
commit d7a2f4a515
9 changed files with 233 additions and 39 deletions

View file

@ -22,6 +22,7 @@
<modals-raw-cover-preview-modal />
<modals-share-modal />
<modals-item-move-to-library-modal />
<modals-shortcuts-modal />
<modals-consolidation-conflict-modal
v-model="showConsolidationConflictModal"
:item="consolidationConflictItem"
@ -547,6 +548,13 @@ export default {
return
}
// Show Shortcuts modal prompt
if (name === this.$hotkeys.Global.SHORTCUTS_HELPER) {
this.$store.commit('globals/setShowShortcutsModal', true)
e.preventDefault()
return
}
// Modal is open
if (this.$store.state.openModal && Object.values(this.$hotkeys.Modal).includes(name)) {
this.$eventBus.$emit('modal-hotkey', name)
@ -562,7 +570,7 @@ export default {
}
// Batch selecting
if (this.$store.getters['globals/getIsBatchSelectingMediaItems'] && name === 'Escape') {
if (this.$store.getters['globals/getIsBatchSelectingMediaItems'] && name === this.$hotkeys.Batch.CANCEL) {
// ESCAPE key cancels batch selection
this.$store.commit('globals/resetSelectedMediaItems', [])
this.$eventBus.$emit('bookshelf_clear_selection')