docs: sync plan with final review fixes

This commit is contained in:
loki committed 2026-08-31 14:49:24 +02:00
1 parent 2128311429
commit f245920b5a
1 file changed
+21
@@ -585,6 +585,11 @@ git commit -m "feat: service polls headset status and warns on low battery"
```lua
local hsc = require("./lib/hsc.luau")
hsc.init({
device = noctalia.getConfig("device"),
mock = noctalia.getConfig("mock"),
})
local battery = { status = "BATTERY_UNAVAILABLE", level = -1 }
local chatmix = 0
local caps = {}
@@ -748,6 +753,11 @@ git commit -m "feat: bar widget shows battery with scroll-sidetone control"
```lua
local hsc = require("./lib/hsc.luau")
hsc.init({
device = noctalia.getConfig("device"),
mock = noctalia.getConfig("mock"),
})
local state = {
open = false,
device = nil,
@@ -1023,6 +1033,11 @@ git commit -m "feat: control panel with sidetone, EQ, and headset controls"
```lua
local hsc = require("./lib/hsc.luau")
hsc.init({
device = noctalia.getConfig("device"),
mock = noctalia.getConfig("mock"),
})
local on = false
local battery = nil
local capsSidetone = false
@@ -1277,3 +1292,9 @@ git commit -m "docs: README, license, and store thumbnail"
**Placeholder scan:** No TBD/TODO; every code step contains complete code; every verification step has an exact command and expected result.
**Type consistency:** State keys are consistent across files — `caps`, `equalizerPresets`, `device` (table `{name, product, vendor}`), `battery` (`{status, level}`), `chatmix`, `sidetone`, `error`, `lastUpdate`. Callback names (`onSidetone`, `onSidetoneEnd`, `onSidetoneOff`, `onEqPreset`, `onInactive`, `onVoicePrompts`, `onVolumeLimiter`, `onCloseClicked`) are registered as globals in `panel.luau` and referenced by string in the ui tree. `hsc.chatmixText` is defined once and used by both widget and panel. Mock battery field `equalizerPresets` matches manifest setting-free state key used by panel.
**Final review fixes (all applied and re-reviewed):**
- Each entry (`widget`, `panel`, `shortcut`) calls `hsc.init({ device = ..., mock = ... })` after requiring `lib/hsc.luau` — Noctalia gives each entry its own module instance, so without this, mock mode and the `device` VID:PID setting were bypassed for their control commands.
- `plugin.toml` panel declares `dismiss_on_outside_click = true` explicitly (matches the design spec; default is already true).
- Panel shows a `panel.no_caps` hint when no capability control is rendered.
- Panel sidetone default reads `sidetone_default` config (not a hardcoded 64).