From 0510aafeb6c33c9de2e46628cbcce3e62b4e82a5 Mon Sep 17 00:00:00 2001 From: Rod Begbie Date: Sun, 5 Apr 2026 14:07:44 -0700 Subject: [PATCH 01/10] Add design doc for configurable volume increment setting Co-Authored-By: Claude Sonnet 4.6 --- ...6-04-05-volume-increment-setting-design.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 docs/superpowers/specs/2026-04-05-volume-increment-setting-design.md diff --git a/docs/superpowers/specs/2026-04-05-volume-increment-setting-design.md b/docs/superpowers/specs/2026-04-05-volume-increment-setting-design.md new file mode 100644 index 0000000..56a3a8f --- /dev/null +++ b/docs/superpowers/specs/2026-04-05-volume-increment-setting-design.md @@ -0,0 +1,48 @@ +# Volume Increment Setting — Design + +## Overview + +Expose the volume increment for the Volume Up and Volume Down actions as a configurable setting. A global default applies to all volume buttons; individual buttons can override it. + +## Requirements + +- Global default increment: `10` (min: `1`, no enforced max) +- Per-button override: optional; absent means "use global" +- Volume range hint displayed in UI: "Volume range: 0–100" +- Fix manifest tooltips: "by 2" → "by 10" + +## Architecture + +### Global settings (`PiComponent.vue` + `PluginComponent.vue`) + +Add `adjustVolumeIncrement` to the global settings payload: + +- **PI (`PiComponent.vue`):** Add a number input in the Global Settings accordion, below the existing timeout/interval inputs. Label: "Volume Increment (Up/Down)". Helper text: "Volume range: 0–100". Min: 1. +- **`saveGlobalSettings()`:** Include `adjustVolumeIncrement` in the payload saved via `streamDeckConnection.value.saveGlobalSettings()`. +- **`PluginComponent.vue`:** On `globalsettings`, extract `inGlobalSettings.adjustVolumeIncrement` (defaulting to `10`) into a reactive ref `adjustVolumeIncrement`, mirroring the existing `deviceTimeoutDuration` pattern. + +### Per-button settings (`PiComponent.vue`) + +For `actionName === 'volume-up'` and `actionName === 'volume-down'`, show an action-specific section with a number input for `adjustVolumeIncrement`. Label: "Volume Increment". Helper: "Volume range: 0–100. Leave blank to use the global default." Min: 1. The field is optional — only written to `actionSettings` when the user provides a value; absent/null means inherit from global. + +The `saveSettings()` function already writes all `actionSettings` fields unconditionally. The per-button `adjustVolumeIncrement` should only be included when the user has set a value (i.e. the ref is non-null/non-empty). + +### Action handlers (`src/modules/actions/sonosController.js`) + +Add `globalAdjustVolumeIncrement` as a named parameter to `volume_up_action` and `volume_down_action`. Resolution: + +```js +const increment = parseInt(inActionSettings.adjustVolumeIncrement) || globalAdjustVolumeIncrement; +``` + +Remove the existing `|| 10` fallback — the global value is always present. + +### Passing global value to actions (`PluginComponent.vue`) + +Where action handlers are called, pass `globalAdjustVolumeIncrement: adjustVolumeIncrement.value` alongside the existing `deviceTimeoutDuration`, mirroring that pattern exactly. + +## Manifest fix + +In `public/manifest.json`, update: +- Volume Up `Tooltip`: `"Increase volume by 2"` → `"Increase volume by 10"` +- Volume Down `Tooltip`: `"Decrease volume by 2"` → `"Decrease volume by 10"` From c909e54623fcd2d07314af35549d7cb37dcce8fc Mon Sep 17 00:00:00 2001 From: Rod Begbie Date: Sun, 5 Apr 2026 14:09:17 -0700 Subject: [PATCH 02/10] Update spec: remove hardcoded increment from manifest tooltips Co-Authored-By: Claude Sonnet 4.6 --- .../specs/2026-04-05-volume-increment-setting-design.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/superpowers/specs/2026-04-05-volume-increment-setting-design.md b/docs/superpowers/specs/2026-04-05-volume-increment-setting-design.md index 56a3a8f..6f7125a 100644 --- a/docs/superpowers/specs/2026-04-05-volume-increment-setting-design.md +++ b/docs/superpowers/specs/2026-04-05-volume-increment-setting-design.md @@ -43,6 +43,6 @@ Where action handlers are called, pass `globalAdjustVolumeIncrement: adjustVolum ## Manifest fix -In `public/manifest.json`, update: -- Volume Up `Tooltip`: `"Increase volume by 2"` → `"Increase volume by 10"` -- Volume Down `Tooltip`: `"Decrease volume by 2"` → `"Decrease volume by 10"` +In `public/manifest.json`, remove the hardcoded increment from both tooltips (it would become inaccurate once the setting is configurable): +- Volume Up `Tooltip`: `"Increase volume by 2"` → `"Increase volume"` +- Volume Down `Tooltip`: `"Decrease volume by 2"` → `"Decrease volume"` From 210cbd4b2e79b89207385cc9d794c4229bbf620e Mon Sep 17 00:00:00 2001 From: Rod Begbie Date: Sun, 5 Apr 2026 14:12:02 -0700 Subject: [PATCH 03/10] Add implementation plan for volume increment setting Co-Authored-By: Claude Sonnet 4.6 --- .../2026-04-05-volume-increment-setting.md | 438 ++++++++++++++++++ 1 file changed, 438 insertions(+) create mode 100644 docs/superpowers/plans/2026-04-05-volume-increment-setting.md diff --git a/docs/superpowers/plans/2026-04-05-volume-increment-setting.md b/docs/superpowers/plans/2026-04-05-volume-increment-setting.md new file mode 100644 index 0000000..7bd821f --- /dev/null +++ b/docs/superpowers/plans/2026-04-05-volume-increment-setting.md @@ -0,0 +1,438 @@ +# Volume Increment Setting Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Expose a configurable volume increment for Volume Up/Down actions, with a global default and optional per-button override. + +**Architecture:** Global `adjustVolumeIncrement` (default `10`) is stored in Stream Deck global settings and threaded through `PluginComponent.vue` to the action handlers. Per-button `adjustVolumeIncrement` is stored in each action's `actionSettings` and takes precedence when set. The PI for volume actions shows an optional override input; the Global Settings accordion shows the default input. + +**Tech Stack:** Vue 3, Vite, Stream Deck SDK (`@elgato/streamdeck`), Bootstrap 5 + +--- + +## File Map + +| File | Change | +|------|--------| +| `public/manifest.json` | Remove hardcoded "by 2" from Volume Up/Down tooltips | +| `src/modules/actions/sonosController.js` | Add `globalAdjustVolumeIncrement` param to `volume_up_action` and `volume_down_action`; update increment resolution | +| `src/components/PluginComponent.vue` | Extract `adjustVolumeIncrement` from global settings; pass to action call site | +| `src/components/PiComponent.vue` | Add global increment setting UI + per-button override UI | + +--- + +### Task 1: Fix manifest tooltips + +**Files:** +- Modify: `public/manifest.json` + +- [ ] **Step 1: Update Volume Up tooltip** + +In `public/manifest.json`, find the Volume Up action (`"UUID": "com.r-teller.sonoscontroller.volume-up"`) and change its `Tooltip`: + +```json +"Tooltip": "Increase volume", +``` + +- [ ] **Step 2: Update Volume Down tooltip** + +In the same file, find the Volume Down action (`"UUID": "com.r-teller.sonoscontroller.volume-down"`) and change its `Tooltip`: + +```json +"Tooltip": "Decrease volume", +``` + +- [ ] **Step 3: Commit** + +```bash +git add public/manifest.json +git commit -m "fix: remove hardcoded increment value from volume action tooltips" +``` + +--- + +### Task 2: Update action handlers to accept global increment + +**Files:** +- Modify: `src/modules/actions/sonosController.js` + +There is no test suite in this project. Verify changes by building (`npm run build_dev`) and testing manually in Stream Deck. + +- [ ] **Step 1: Update `volume_up_action` signature and increment resolution** + +Find `volume_up_action` (currently starts around `export async function volume_up_action({`). Update its signature and the line that computes `updatedVolume`: + +Old signature: +```js +export async function volume_up_action({ inContext, inActionSettings, inSonosSpeakerState, deviceTimeoutDuration = 1 }) { +``` + +New signature: +```js +export async function volume_up_action({ inContext, inActionSettings, inSonosSpeakerState, deviceTimeoutDuration = 1, globalAdjustVolumeIncrement = 10 }) { +``` + +Old increment line (inside the function): +```js +parseInt(inSonosSpeakerState.audioEqualizer.volume) + (parseInt(inActionSettings.adjustVolumeIncrement) || 10), +``` + +New increment line: +```js +parseInt(inSonosSpeakerState.audioEqualizer.volume) + (parseInt(inActionSettings.adjustVolumeIncrement) || globalAdjustVolumeIncrement), +``` + +- [ ] **Step 2: Update `volume_down_action` signature and increment resolution** + +Find `volume_down_action`. Apply the same changes: + +Old signature: +```js +export async function volume_down_action({ inContext, inActionSettings, inSonosSpeakerState, deviceTimeoutDuration = 1 }) { +``` + +New signature: +```js +export async function volume_down_action({ inContext, inActionSettings, inSonosSpeakerState, deviceTimeoutDuration = 1, globalAdjustVolumeIncrement = 10 }) { +``` + +Old increment line: +```js +parseInt(inSonosSpeakerState.audioEqualizer.volume) - (parseInt(inActionSettings.adjustVolumeIncrement) || 10), +``` + +New increment line: +```js +parseInt(inSonosSpeakerState.audioEqualizer.volume) - (parseInt(inActionSettings.adjustVolumeIncrement) || globalAdjustVolumeIncrement), +``` + +- [ ] **Step 3: Commit** + +```bash +git add src/modules/actions/sonosController.js +git commit -m "feat: add globalAdjustVolumeIncrement param to volume up/down actions" +``` + +--- + +### Task 3: Thread global increment through PluginComponent + +**Files:** +- Modify: `src/components/PluginComponent.vue` + +- [ ] **Step 1: Add reactive ref for global increment** + +Find the block of `const` refs at the top of `