Skip to content

Add Chapter Marker and Camera Background actions - #19

Merged
zv1n merged 7 commits into
mainfrom
streamdeck-dev/chapter-marker-and-camera-background
Nov 10, 2026
Merged

zv1n merged 7 commits into
mainfrom
streamdeck-dev/chapter-marker-and-camera-background

Conversation

@zv1n

@zv1n zv1n commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two new actions, plus a base-class fix they surfaced.

  • Chapter Marker sends meld.insertRecordingChapterMarker via sendCommand. The key lights while Meld is recording. Presses are always forwarded: Meld's own command is disabled outside a recording and drops them itself, so the plugin does not second-guess a flag that can lag.
  • Camera Background toggles, enables or disables a camera layer's backgroundEffectEnabled (the per-layer "Background" switch in Meld) through setProperty. Blur vs removal stays a device-level setting chosen in Meld.
  • SessionToggleAction.toggle() now receives the resolved next value. Actions without a native Meld toggle were re-reading the snapshot, which still predates a press made inside Meld's autosave debounce, so a quick second press rewrote the first value instead of undoing it. Caught by the new double-press test.
  • Pending presses are shared per target, not per key. Two keys on the same layer, effect or track now build on each other's presses inside the debounce (for Camera Background, which writes absolute values, the second key used to repeat the first write), and every key on the target repaints. A force press whose state is unknown is forwarded without painting a state no snapshot will confirm.

Both actions come with key and action icons in the existing style, en / de / pt_BR strings, inspector pages, WebChannelAPI.md updates, README changelog, and a bump to 0.6.5.0 (package-lock.json aligned; it had been left at 0.6.4.1).

Meld-side dependency

Meld's StreamDeckMapper.cpp layerToMap does not yet publish backgroundEffectEnabled. On Meld Studio 0.10.7.5 and later, Enable and Disable work without it (the property write is accepted; earlier builds have no such property), but Toggle, live key state and camera-only filtering in the inspector need the field. Once Meld publishes it, keys pointing at a non-camera layer (possible when configured against an older build) are never written to. The plugin is forward-compatible: the inspector lists every layer and shows a caution until Meld publishes it, and Toggle logs a warning instead of guessing. The Meld change is one line, adding "backgroundEffectEnabled" to kProperties: MeldStudio/MeldStudio#6985. The chapter marker command currently ignores args, so no marker title can be passed yet.

Test plan

  • npm run typecheck
  • npm test (185 passing, including new test/chapter-marker.test.ts and test/background-effect.test.ts with Meld-restart scenarios)
  • npm run build
  • npx streamdeck validate co.meldstudio.streamdeck.sdPlugin
  • Install via scripts/install.sh and try both keys against a running Meld (Camera Background Toggle needs MeldStudio/MeldStudio#6985)

Note: the local-only npm run coverage gate reports functions at 74.96% against a 75% threshold. The shortfall is the never-called accept helper in each @action-decorated file's compiled decorator boilerplate, not uncovered plugin code. CI does not run coverage; threshold left as is for a separate decision.

🤖 Generated with Claude Code

zv1n and others added 7 commits November 9, 2026 10:50
Actions without a native Meld toggle call had to re-read the session
snapshot to pick the value to write, but that snapshot still predates
any press made within Meld's autosave debounce, so a quick second press
rewrote the first value instead of undoing it. The base class already
derives the correct target from the pending optimistic press; hand it
to toggle(settings, next) so subclasses never guess.

Also adds the optional camera-only `backgroundEffectEnabled` field to
LayerItem and to the test SessionBuilder's layer options.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Chapter Marker sends `meld.insertRecordingChapterMarker` through
sendCommand. The key lights while Meld is recording; presses are always
forwarded because Meld's own CommandAction is disabled outside a
recording and drops them itself, so the plugin never second-guesses a
flag that can lag the real state.

Camera Background toggles (or forces on / off) a camera layer's
`backgroundEffectEnabled`, the per-layer "Background" switch in Meld.
There is no toggle command for it, so the action writes the value
through setProperty. Enable and Disable work against every Meld build
that accepts the property; Toggle, live key state and camera-only
filtering in the inspector light up once Meld's StreamDeckMapper
publishes the field in the layer snapshot. Until then the inspector
lists every layer and shows a caution explaining which modes work.

Both actions ship key and action icons in the existing style, en / de /
pt_BR strings, and node:test coverage against the Meld mock including a
Meld restart mid-session.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
WebChannelAPI.md gains the `backgroundEffectEnabled` layer field, the
chapter marker commands and a setProperty example. The plugin README's
What's New and Change History cover the release; package-lock.json is
aligned with package.json (it had been left at 0.6.4.1 by the previous
bump).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Replaces the placeholder key and action icons with the designer's set
from the Stream Deck Update drop: cameraBg / cameraBg-off and
chapterMarker / chapterMarker-off key images at 72 and 144 px, and the
matching 20 / 40 px action SVGs. Manifest paths follow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Pending presses were keyed by the Stream Deck context, so a second key on
the same layer, effect or track reasoned from the stale snapshot inside
Meld's autosave debounce. For native toggles that only misled the key's
paint; for an action that writes an absolute value it lost a press. The
pending value is now keyed by the migrated target id, every key on that
target repaints when it changes, and retarget / disappear no longer need
to clear it.

A force press whose current value is unknown is forwarded without
painting or remembering the desired state, since no snapshot will ever
confirm it. A new canAct() hook lets an action ignore presses outright
when the connected Meld cannot carry them out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Once Meld publishes backgroundEffectEnabled, a layer without it is not
  a camera, so Enable / Disable no longer write to an image or text layer
  chosen while an older build listed every layer.
- Ignore presses when Meld has no setProperty instead of painting a state
  nothing will confirm.
- List vertical scenes in the inspector; the switch belongs to the camera
  wherever it sits, as with Toggle Layer.
- State that writing the property needs Meld Studio 0.10.7.5 or later.
- Test legacy behaviour against a snapshot where no layer carries the
  field, and cover two keys on one camera and mixed Toggle / Enable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It is kept in the Change History below the main body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zv1n
zv1n merged commit 9c84ce3 into main Nov 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant