From d82f44188a91a6122c4d333a3df94e8ed8e6f289 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 23 Oct 2026 17:15:35 +0200 Subject: assistant settings: a cloud switch per tool; cloud Prefer rows show The Prefer rows for cloud models never built: the shell's JS engine has no Array.prototype.flatMap, and the Repeater's model threw a TypeError (seen in qs log). The ids are now joined with reduce in the module. Each tool row gains a cloud switch, applied on Save after the renames: it writes or drops a top-level cloud = true, validated with tomllib and replaced atomically, on name.toml or name.toml.off. Co-Authored-By: Claude Opus 5.5 --- desktop/modules/assistant/AssistantPage.qml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'desktop/modules/assistant/AssistantPage.qml') diff --git a/desktop/modules/assistant/AssistantPage.qml b/desktop/modules/assistant/AssistantPage.qml index 5878b3b..bf35763 100644 --- a/desktop/modules/assistant/AssistantPage.qml +++ b/desktop/modules/assistant/AssistantPage.qml @@ -233,7 +233,7 @@ Column { // The saved cloud models: Prefer only, there is nothing to load. Repeater { - model: page.asst.savedClouds.flatMap(c => c.models.map(m => c.name + ":" + m)) + model: page.asst.cloudIds delegate: Rectangle { id: cloudRow @@ -640,7 +640,8 @@ Column { Small { width: page.width wrapMode: Text.Wrap - text: "What the model may call. Off renames the file to .toml.off, which the daemon skips." + text: "What the model may call. Off renames the file to .toml.off, which the daemon skips. " + + "Cloud also offers it to cloud chats, which then receive its results." } Repeater { @@ -659,9 +660,24 @@ Column { checked: page.asst.toolOn(toolRow.modelData) onToggled: page.asst.toggleTool(toolRow.modelData) } + // nf-fa-cloud, then the tool's cloud = true. + Switch { + id: cloudSw + anchors { right: parent.right; verticalCenter: parent.verticalCenter } + checked: page.asst.toolCloud(toolRow.modelData) + onToggled: page.asst.toggleCloud(toolRow.modelData) + } + Text { + id: cloudMark + anchors { right: cloudSw.left; rightMargin: 8; verticalCenter: parent.verticalCenter } + text: "\uf0c2" + color: page.asst.toolCloud(toolRow.modelData) ? Theme.text : Theme.subtext + font { family: Theme.iconFamily; pixelSize: Theme.fontSize - 4 } + } Column { id: toolText - anchors { left: toolSw.right; leftMargin: 10; right: parent.right; verticalCenter: parent.verticalCenter } + 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 -- cgit v1.2.3