diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-17 09:31:18 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-17 09:31:18 +0100 |
| commit | bc2a46b48248e7b153194ab22cadd9430c4adb8f (patch) | |
| tree | 61910ca2698c8083b43c2ef77805fea7c50010d3 /desktop/modules | |
| parent | eb81546609a1decc8e8ac4bc3856b6b17269777d (diff) | |
| download | quickshell-bc2a46b48248e7b153194ab22cadd9430c4adb8f.tar.gz quickshell-bc2a46b48248e7b153194ab22cadd9430c4adb8f.zip | |
feat(assistant): read-only tools get a chip by the name
A tool whose description ends "Read-only." shows that as a small chip
next to its name on the Tools list, and the sentence is dropped from
the description shown below it. Only the display changes: the .toml
keeps the sentence, because the model reads the description too and
the hint matters there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules')
| -rw-r--r-- | desktop/modules/assistant/AssistantPage.qml | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/desktop/modules/assistant/AssistantPage.qml b/desktop/modules/assistant/AssistantPage.qml index b25b33b..d74e66b 100644 --- a/desktop/modules/assistant/AssistantPage.qml +++ b/desktop/modules/assistant/AssistantPage.qml @@ -680,15 +680,39 @@ Column { id: toolText anchors { left: toolSw.right; leftMargin: 10; right: cloudMark.left; rightMargin: 10 verticalCenter: parent.verticalCenter } - Text { - text: toolRow.modelData.name - color: page.asst.toolOn(toolRow.modelData) ? Theme.text : Theme.subtext - font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true } + // A description ending "Read-only." shows it as a chip by + // the name instead. The toml keeps the sentence: the model + // reads the description too. + readonly property var ro: /\s*Read-only\.\s*$/.exec(toolRow.modelData.description ?? "") + Row { + spacing: 8 + Text { + anchors.verticalCenter: parent.verticalCenter + text: toolRow.modelData.name + color: page.asst.toolOn(toolRow.modelData) ? Theme.text : Theme.subtext + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true } + } + Rectangle { + anchors.verticalCenter: parent.verticalCenter + visible: toolText.ro !== null + width: roText.implicitWidth + 12 + height: roText.implicitHeight + 4 + radius: height / 2 + color: Qt.alpha(Theme.overlay, 0.35) + Text { + id: roText + anchors.centerIn: parent + text: "read only" + color: Theme.subtext + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 5 } + } + } } Small { width: parent.width wrapMode: Text.Wrap - text: toolRow.modelData.description + text: toolText.ro ? toolRow.modelData.description.slice(0, toolText.ro.index) + : toolRow.modelData.description } } } |
