From 3ef371f9b94a7ca76ed2576bf822487a3e3d513f Mon Sep 17 00:00:00 2001 From: VirtualMachinist Date: Wed, 23 Sep 2026 22:10:27 -0400 Subject: [PATCH] fix: G1f read settings.vaultPath live in rerun, refresh, click injectProps assigns settings before the vaultPath binding flushes, so rerun() read the stale "" and stayed on the empty-vault status. vaultPathNow() reads settings.vaultPath directly; rerun(), refresh(), and the click launcher call it instead of touching the property. No Qt.callLater, no new signal. Kept: onExited refresh(code, collector.text); still-false running folds Model.statusFromRun(127, "", ""); no onFailedToStart. --- BarWidget.qml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/BarWidget.qml b/BarWidget.qml index 055fc01..1dd262c 100644 --- a/BarWidget.qml +++ b/BarWidget.qml @@ -24,12 +24,6 @@ Item { // assigns vaultPath directly. The manifest schema key is vaultPath. property var settings: ({}) - // Derived from settings.vaultPath (schema key). Empty/missing keeps - // the empty-vault failed status. - readonly property string vaultPath: - (settings && typeof settings.vaultPath === "string") - ? settings.vaultPath : "" - // Status from Model.js. Starts as the empty-vault failed status; // a run only replaces it when a vault path is set. property var status: Model.statusForEmptyVault() @@ -37,17 +31,27 @@ Item { implicitWidth: row.implicitWidth + 16 implicitHeight: 22 + // Live settings read. The vaultPath binding may not have flushed when + // onSettingsChanged fires (injectProps assigns settings first), so + // rerun()/refresh()/the click read settings.vaultPath directly — never + // the property. + function vaultPathNow() { + return (settings && typeof settings.vaultPath === "string") + ? settings.vaultPath : ""; + } + // Fold a finished run into the bar status via Model.js. function refresh(code, stdout) { - status = Model.statusFor(vaultPath, code, stdout, ""); + status = Model.statusFor(vaultPathNow(), code, stdout, ""); } function rerun() { - if (!Model.hasVault(vaultPath)) { + var vault = vaultPathNow(); + if (!Model.hasVault(vault)) { status = Model.statusForEmptyVault(); return; } - geodeRun.command = Model.listArgs(vaultPath); + geodeRun.command = Model.listArgs(vault); geodeRun.running = true; // A missing `geode` binary never emits `exited`: the run stays // running=false (pid null). That is the failed-to-start shape on @@ -112,7 +116,7 @@ Item { } // Token-free launch: `geode tui` + vault path only. Never // `--token`; never any agent-plane or mutating verb from chrome. - Quickshell.execDetached(["geode", "tui", root.vaultPath]); + Quickshell.execDetached(["geode", "tui", root.vaultPathNow()]); } } }