From de8294eab208b95cef9bd376d98fb232e3a4c4c4 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 13 Oct 2026 09:59:53 +0200 Subject: fix(island): review findings in the controls panel Edit mode let a right-click and the wheel through to the tile, so a right-click opened the drawer and scroll changed volume, against the spec. The drag area now takes both buttons and the wheel. A scroll up on a level already above the cap, such as a mic set to 120% elsewhere, snapped it down to the cap. The cap now only stops a step up. Prefs logs a failed write, which printErrors off had silenced: the new order would otherwise vanish at the next restart with no trace. Its parsed object is renamed from data to doc, so it cannot shadow a base property of that name. The spec now says what was built: JSON.parse rather than a JsonAdapter, and the helper list as it is. Co-Authored-By: Claude Opus 5.5 --- desktop/Prefs.qml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'desktop/Prefs.qml') diff --git a/desktop/Prefs.qml b/desktop/Prefs.qml index dd2fdfc..d56b34c 100644 --- a/desktop/Prefs.qml +++ b/desktop/Prefs.qml @@ -34,12 +34,12 @@ Singleton { // The whole parsed object, so a write keeps keys this version does not // know about. - property var data: ({}) + property var doc: ({}) function setControls(list) { root.controls = Controls.normalize(list); - const out = Object.assign({}, root.data, { controls: root.controls }); - root.data = out; + const out = Object.assign({}, root.doc, { controls: root.controls }); + root.doc = out; file.setText(JSON.stringify(out, null, 2) + "\n"); } @@ -49,7 +49,7 @@ Singleton { const v = JSON.parse(file.text()); if (v && typeof v === "object" && !Array.isArray(v)) parsed = v; } catch (e) {} - root.data = parsed; + root.doc = parsed; const next = "controls" in parsed ? Controls.normalize(parsed.controls) : Controls.defaults(); // The watch also fires on our own write; compare so it is a no-op. if (JSON.stringify(next) !== JSON.stringify(root.controls)) root.controls = next; @@ -61,9 +61,12 @@ Singleton { atomicWrites: true watchChanges: true printErrors: false + // printErrors is off for the missing-file read; a failed write still + // has to be heard, or the new order silently vanishes at restart. + onSaveFailed: error => console.warn("Prefs: writing", root.path, "failed:", error) onFileChanged: reload() onLoaded: root.reparse() // Missing file: the defaults, and nothing written. - onLoadFailed: { root.data = {}; root.controls = Controls.defaults(); } + onLoadFailed: { root.doc = {}; root.controls = Controls.defaults(); } } } -- cgit v1.2.3