Insert emojis without persisting clipboard entries

Keep the first emoji result selected whenever results exist, including after search filtering, so Enter inserts immediately.

Route emoji insertion through a hidden helper that serves a transient sensitive clipboard entry long enough for Shift+Insert, then stops that clipboard owner.

Mark transient emoji inserts so clipboard history skips only that event while continuing to record normal terminal copies.
This commit is contained in:
David Heinemeier Hansson
2026-05-29 14:54:49 +02:00
parent 16a4bc8106
commit cd2be9da25
5 changed files with 112 additions and 4 deletions
+5 -3
View File
@@ -44,7 +44,7 @@ Item {
root.opened = true
root.filterText = ""
root.selectedIndex = 0
root.cursorActive = false
root.cursorActive = true
root.rebuildDisplay()
Qt.callLater(function() { keyCatcher.forceActiveFocus() })
}
@@ -81,6 +81,7 @@ Item {
if (displayModel.count === 0) selectedIndex = 0
else if (selectedIndex >= displayModel.count) selectedIndex = displayModel.count - 1
else if (selectedIndex < 0) selectedIndex = 0
cursorActive = displayModel.count > 0
Qt.callLater(function() {
if (displayModel.count > 0) resultGrid.positionViewAtIndex(root.selectedIndex, GridView.Contain)
@@ -132,7 +133,7 @@ Item {
function setFilter(nextFilter) {
root.filterText = nextFilter
root.selectedIndex = 0
root.cursorActive = false
root.cursorActive = true
root.rebuildDisplay()
}
@@ -145,8 +146,9 @@ Item {
function applySelected(emoji) {
if (!emoji) return
root.dismiss()
Quickshell.execDetached([root.omarchyPath + "/bin/omarchy-clipboard-paste-text", "--shift-insert", emoji])
Quickshell.execDetached([root.omarchyPath + "/bin/omarchy-menu-emoji-insert", emoji])
}
ListModel { id: displayModel }
FileView {