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/island/Controls.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'desktop/island/Controls.js') diff --git a/desktop/island/Controls.js b/desktop/island/Controls.js index 39865b2..0ca2f6c 100644 --- a/desktop/island/Controls.js +++ b/desktop/island/Controls.js @@ -88,9 +88,14 @@ function fill(volume) { } // One scroll step, rounded to the percent so repeated steps do not drift. +// The cap only stops a step up: a level already above it (set elsewhere, +// e.g. a mic at 120% from pavucontrol) is left alone by up and stepped from +// by down, never snapped to the cap. function step(volume, delta, max) { - const v = Math.round(((volume > 0 ? volume : 0) + delta) * 100) / 100; - return Math.max(0, Math.min(max, v)); + const cur = volume > 0 ? volume : 0; + const v = Math.round((cur + delta) * 100) / 100; + if (delta < 0) return Math.max(0, v); + return Math.max(cur, Math.min(max, v)); } // The slot a dragged tile lands in, from its centre in grid coordinates. -- cgit v1.2.3