improve note select

This commit is contained in:
Guilhem
2025-11-12 17:00:16 +01:00
parent 68dc6576b1
commit 05e012c93e
2 changed files with 9 additions and 10 deletions
@@ -480,10 +480,7 @@
// Keyboard event handling
function handleKeyDown(event: KeyboardEvent) {
selectionManager.handleKeyDown(event, nodes)
}
function handleKeyUp(_event: KeyboardEvent) {
// Keep for potential future use
noteManager.handleKeyDown(event)
}
async function updateStores() {
@@ -666,16 +663,10 @@
}
}
function globalKeyUpHandler(event: KeyboardEvent) {
handleKeyUp(event)
}
document.addEventListener('keydown', globalKeyDownHandler)
document.addEventListener('keyup', globalKeyUpHandler)
return () => {
document.removeEventListener('keydown', globalKeyDownHandler)
document.removeEventListener('keyup', globalKeyUpHandler)
}
})
@@ -334,4 +334,12 @@ export class NoteManager {
isNoteSelected(noteId: string): boolean {
return this.selectedNoteId === noteId
}
// Handle keyboard shortcuts
handleKeyDown(event: KeyboardEvent) {
if (event.key === 'Escape') {
// Escape key clears selection regardless of mode
this.clearNoteSelection()
}
}
}