Fix launcher keyboard scrolling

This commit is contained in:
David Heinemeier Hansson
2026-06-28 20:46:46 -04:00
parent ba0d2a764f
commit 67084b153f
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -233,12 +233,14 @@ Item {
root.filterText = nextFilter
root.selectedIndex = 0
root.cursorActive = true
root.hoverArmed = false
root.rebuildDisplay()
}
function select(delta) {
if (displayModel.count === 0) return
root.cursorActive = true
root.hoverArmed = false
root.selectedIndex = (root.selectedIndex + delta + displayModel.count) % displayModel.count
resultList.positionViewAtIndex(root.selectedIndex, ListView.Contain)
}
@@ -456,6 +458,7 @@ Item {
} else if (event.key === Qt.Key_Home) {
if (displayModel.count > 0) {
root.cursorActive = true
root.hoverArmed = false
root.selectedIndex = 0
resultList.positionViewAtIndex(root.selectedIndex, ListView.Contain)
}
@@ -463,6 +466,7 @@ Item {
} else if (event.key === Qt.Key_End) {
if (displayModel.count > 0) {
root.cursorActive = true
root.hoverArmed = false
root.selectedIndex = displayModel.count - 1
resultList.positionViewAtIndex(root.selectedIndex, ListView.Contain)
}
+5
View File
@@ -68,6 +68,11 @@ assertEqual(acronymMatches[0], 'Google Contacts', 'short acronym matching still
const directMatches = search.sortedEntries(entries, 'obs').map(row => search.entryName(row.entry))
assertEqual(directMatches[0], 'OBS Studio', 'direct app-name matching still works')
assert(
/function select\(delta\)[\s\S]*root\.hoverArmed = false[\s\S]*root\.selectedIndex =/.test(launcherQml),
'launcher keyboard navigation disarms stale hover before moving selection'
)
const confirmDeleteMatch = launcherQml.match(/function confirmDelete\(\) \{([\s\S]*?)\n \}/)
assert(confirmDeleteMatch, 'launcher confirmDelete function exists')
assert(