From b4b422bd9c5e17d3f8c8bf65abc7f64c9b826d32 Mon Sep 17 00:00:00 2001 From: tivnantu Date: Sat, 7 Mar 2026 02:00:50 +0800 Subject: [PATCH] fix(quickshell): load extraModels properly in AI sidebar - Use Object.assign in addModel to trigger QML binding recalculation - Load extraModels in Component.onCompleted as fallback when onReadyChanged doesn't fire (Config already ready at load time) --- dots/.config/quickshell/ii/services/Ai.qml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dots/.config/quickshell/ii/services/Ai.qml b/dots/.config/quickshell/ii/services/Ai.qml index a273415f5..b7a5c3d8e 100644 --- a/dots/.config/quickshell/ii/services/Ai.qml +++ b/dots/.config/quickshell/ii/services/Ai.qml @@ -321,6 +321,13 @@ Singleton { Component.onCompleted: { setModel(currentModelId, false, false); // Do necessary setup for model + // Load extra models from config (onReadyChanged may not fire if Config is already ready) + if (Config?.options?.ai?.extraModels) { + Config.options.ai.extraModels.forEach(model => { + const safeModelName = root.safeModelName(model["model"]); + root.addModel(safeModelName, model) + }); + } } function guessModelLogo(model) { @@ -345,7 +352,9 @@ Singleton { } function addModel(modelName, data) { - root.models[modelName] = aiModelComponent.createObject(this, data); + root.models = Object.assign({}, root.models, { + [modelName]: aiModelComponent.createObject(this, data) + }); } Process {