aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/assistant/Segments.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-16 14:16:24 +0200
committerDanilo M. <danix@danix.xyz>2026-10-16 14:16:24 +0200
commitf99a9329caccdd14d9c530777a5e5b622d34f602 (patch)
treefb8351c3485b534cfa2337801f1eea2d973b8f6a /desktop/assistant/Segments.qml
parent729e89b4dce7e6f89a8a20cb919ad1b05d825d09 (diff)
downloadquickshell-f99a9329caccdd14d9c530777a5e5b622d34f602.tar.gz
quickshell-f99a9329caccdd14d9c530777a5e5b622d34f602.zip
fix(assistant): keep focus in the card, scope errors, guard links
From review of the canvas. Escape stopped working in three ways, each leaving the keyboard grabbed with nothing to receive it: the history field hiding took focus with it, a disabled input could not hold focus while the daemon was down, and a click in a streaming reply focused text the next flush destroyed. The card now gives focus back to the input whenever it falls out, and the input is read-only rather than disabled. Only an error the daemon marks as ending the reply (turn) closes the live row; a command error, possibly another client's, used to freeze the reply mid-stream. The running tool comes from state events, hello included. Scrolling up during a stream no longer snaps back, since following stops when a movement starts. History snippets go through Notify.sanitize like any model output, links open only for http, https and mailto, and a line opening with inline triple-backtick code is no longer taken as a fence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/assistant/Segments.qml')
-rw-r--r--desktop/assistant/Segments.qml8
1 files changed, 6 insertions, 2 deletions
diff --git a/desktop/assistant/Segments.qml b/desktop/assistant/Segments.qml
index 2b68b64..cd216df 100644
--- a/desktop/assistant/Segments.qml
+++ b/desktop/assistant/Segments.qml
@@ -45,7 +45,9 @@ Column {
color: Theme.text
selectionColor: Qt.alpha(Theme.accent, 0.4)
font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2 }
- onLinkActivated: link => Qt.openUrlExternally(link)
+ // Web and mail links only: a model-written file: or custom
+ // scheme link would be handed to xdg-open.
+ onLinkActivated: link => { if (/^(https?|mailto):/i.test(link)) Qt.openUrlExternally(link); }
HoverHandler { cursorShape: prose.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor }
}
@@ -77,7 +79,9 @@ Column {
anchors { right: parent.right; top: parent.top; margins: 6 }
visible: !part.modelData.open
width: visible ? implicitWidth : 0
- text: copied.running ? "Copied" : (part.modelData.lang || "Copy")
+ text: copied.running ? "Copied" : "Copy"
+ // ponytail: one argv string, so a block over 128 KiB
+ // (MAX_ARG_STRLEN) fails to copy; stdin if that matters.
onClicked: {
Quickshell.execDetached(["wl-copy", "--", part.modelData.text]);
copied.restart();