Add hotkeys for triaging cards in columns

Hover to select items
This commit is contained in:
Jason Zimdars
2025-12-19 10:15:20 -06:00
parent fa21bc9b61
commit 6e90a6dbfb
10 changed files with 219 additions and 6 deletions
@@ -45,6 +45,10 @@ export default class extends Controller {
this.selectItem(target, true)
}
hoverSelect({ currentTarget }) {
this.selectItem(currentTarget)
}
selectCurrentOrReset(event) {
if (this.currentItem) {
this.#setCurrentFrom(this.currentItem)
@@ -221,6 +225,20 @@ export default class extends Controller {
})
}
// Public accessors for card_hotkeys_controller outlet
get visibleItems() {
return this.#visibleItems
}
clearSelection() {
this.#clearSelection()
this.currentItem = null
}
get hasFocus() {
return this.element.contains(document.activeElement)
}
#keyHandlers = {
ArrowDown(event) {
if (this.supportsVerticalNavigationValue) {
@@ -253,6 +271,6 @@ export default class extends Controller {
} else {
this.#clickCurrentItem(event)
}
},
}
}
}