diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-21 10:20:18 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-21 10:20:18 +0200 |
| commit | a16a02a12f6945c1b9e0b1e6a5716678f50eaa93 (patch) | |
| tree | fe483fcf2fd00bde5658a4c0bd5b7362ceb094a1 /desktop/modules/sbbuilder/SbbVmModule.qml | |
| parent | 82ddf40282e7dc913a241a8f31cb2855b1bb74da (diff) | |
| download | quickshell-a16a02a12f6945c1b9e0b1e6a5716678f50eaa93.tar.gz quickshell-a16a02a12f6945c1b9e0b1e6a5716678f50eaa93.zip | |
sbbuilder: fixes from review
Toml: a value followed by anything but a comment was parsed as if the
line ended there, so a multi-line string (which opens with an empty one)
or `x = "a" junk` read as valid and set() could write a duplicate or
mangle it. entries() now skips such lines and set() refuses them with the
existing "cannot edit" error. The ponytail comment names the ceilings.
Store: a failed put left Save enabled with a stale draft; it now marks the
key invalid. An empty manifest URL used to unset, which removed the row
being typed in; it now marks the row invalid instead (Setting clears the
mark just before set, so the one made inside set stays). Noted that list
entries with spaces cannot be entered here.
Sbb: refresh() ran an ssh fetch for the desktop page too and let two
fetches overlap, or one run during a save. It is split into reloadDesktop()
and fetch(false), and fetch() returns while busy. A successful config-get
clears a stale VM error, and a missing text reads as empty. The put now
writes and records the draft as sent, so typing during the save is not
marked saved.
SbbVmModule: fields are read-only while busy, a Reload button sits beside
the status line, and the manifest URL field says Remove deletes the row.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/sbbuilder/SbbVmModule.qml')
| -rw-r--r-- | desktop/modules/sbbuilder/SbbVmModule.qml | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/desktop/modules/sbbuilder/SbbVmModule.qml b/desktop/modules/sbbuilder/SbbVmModule.qml index 8b9cebc..45c7216 100644 --- a/desktop/modules/sbbuilder/SbbVmModule.qml +++ b/desktop/modules/sbbuilder/SbbVmModule.qml @@ -32,7 +32,7 @@ Module { ["genreprc", "genreprc"], ["slackrepo_logdir", "slackrepo logs"], ["phantom_deps_file", "Phantom deps"]] searchItems: fields.map(f => ({ text: f[1], key: "/" + f[0] })) .concat(Sbb.vm.manifests.map(p => ({ text: p + " manifest", key: "manifests/" + p }))) - function refresh() { Sbb.refresh(); } + function refresh() { Sbb.fetch(false); } page: Component { Page { @@ -50,20 +50,33 @@ Module { spacing: 6 readonly property var st: Sbb.vm property string confirming: "" - Text { + Item { width: col.width - wrapMode: Text.Wrap - text: Sbb.busy ? "Asking the VM..." - : Sbb.reachable ? Sbb.vmPath + " on the VM. The helper checks a save and keeps the old file as .bak." - : "The VM did not answer, so nothing here can change. Start it, then reopen this page." - color: Sbb.reachable || Sbb.busy ? Theme.subtext : Theme.yellow - font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } + height: Math.max(status.implicitHeight, reload.height) + Text { + id: status + anchors { left: parent.left; right: reload.left; rightMargin: 8; verticalCenter: parent.verticalCenter } + wrapMode: Text.Wrap + text: Sbb.busy ? "Asking the VM..." + : Sbb.reachable ? Sbb.vmPath + " on the VM. The helper checks a save and keeps the old file as .bak." + : "The VM did not answer, so nothing here can change. Start it, then Reload." + color: Sbb.reachable || Sbb.busy ? Theme.subtext : Theme.yellow + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } + } + Button { + id: reload + anchors { right: parent.right; verticalCenter: parent.verticalCenter } + text: "Reload" + enabled: !Sbb.busy + onClicked: Sbb.fetch(false) + } } Column { width: col.width spacing: 6 - enabled: Sbb.reachable + // Read-only while a save runs too: typing then would be lost or mis-recorded. + enabled: Sbb.reachable && !Sbb.busy opacity: Sbb.reachable ? 1 : 0.5 Repeater { model: [ @@ -116,6 +129,7 @@ Module { id: url width: parent.width - del.width - 8 store: col.st; section: "manifests"; key: mrow.modelData; label: mrow.modelData + placeholder: "a URL; Remove deletes the row" } Button { id: del |
