From 1a5c04780f7ec7ab1055cd4594aae3e6374fedd0 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 4 Dec 2026 11:32:56 +0100 Subject: feat(assistant): writes or read only chip on every tool The chip came from a description ending "Read-only.", which most tools lack. It now reads the tool file's writes key: peach "writes", green "read only". Co-Authored-By: Claude Opus 5.5 --- desktop/modules/assistant/AssistantPage.qml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'desktop/modules/assistant/AssistantPage.qml') diff --git a/desktop/modules/assistant/AssistantPage.qml b/desktop/modules/assistant/AssistantPage.qml index 680692f..7691cb5 100644 --- a/desktop/modules/assistant/AssistantPage.qml +++ b/desktop/modules/assistant/AssistantPage.qml @@ -745,10 +745,12 @@ Column { id: toolText anchors { left: toolSw.right; leftMargin: 10; right: cloudMark.left; rightMargin: 10 verticalCenter: parent.verticalCenter } - // 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. + // Every tool gets a chip: "writes" for one whose toml says + // writes = true, "read only" otherwise. A description ending + // "Read-only." drops that sentence here; the toml keeps it, + // since the model reads the description too. readonly property var ro: /\s*Read-only\.\s*$/.exec(toolRow.modelData.description ?? "") + readonly property color chip: toolRow.modelData.writes ? Theme.peach : Theme.green Row { spacing: 8 Text { @@ -759,16 +761,16 @@ Column { } 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) + color: Qt.alpha(toolText.chip, 0.18) + border { width: 1; color: Qt.alpha(toolText.chip, 0.55) } Text { id: roText anchors.centerIn: parent - text: "read only" - color: Theme.subtext + text: toolRow.modelData.writes ? "writes" : "read only" + color: toolText.chip font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 5 } } } -- cgit v1.2.3