The viewer this one replaced bound three shortcuts on window while it was open:
keyboardDeleteFile(event) {
if (this.canDelete && event.key === 'Delete' && event.ctrlKey === true) this.onDelete()
}
keyboardDownloadFile(event) {
if (event.key === 's' && event.ctrlKey === true) { event.preventDefault(); if (this.canDownload) this.onDownload() }
}
keyboardEditFile(event) {
if (event.key === 'e' && event.ctrlKey === true) { event.preventDefault(); if (this.canEdit) this.onEdit() }
}
There is no keyboard handling of any kind in the library now — grep for addEventListener('key, @keydown and useHotKey across lib/ returns nothing.
Worth checking before reimplementing them here: the download and delete actions are rendered from the Files actions registry now rather than being the viewer's own buttons, so those two may already register their own shortcuts. If they do, only edit needs one, and it should be registered the way the rest of the frontend does it rather than as a bare window listener.
Edit also has a condition it did not have before: it is now gated on the file's write permission, so a shortcut has to respect that too.
Found while reading the old viewer for regressions; the others from that pass are fixed.
The viewer this one replaced bound three shortcuts on
windowwhile it was open:There is no keyboard handling of any kind in the library now —
grepforaddEventListener('key,@keydownanduseHotKeyacrosslib/returns nothing.Worth checking before reimplementing them here: the download and delete actions are rendered from the Files actions registry now rather than being the viewer's own buttons, so those two may already register their own shortcuts. If they do, only edit needs one, and it should be registered the way the rest of the frontend does it rather than as a bare
windowlistener.Edit also has a condition it did not have before: it is now gated on the file's write permission, so a shortcut has to respect that too.
Found while reading the old viewer for regressions; the others from that pass are fixed.