Skip to content

Tell macOS operators talkback is not there, instead of failing quietly - #242

Merged
iamfatness merged 1 commit into
mainfrom
feat/talkback-macos-gate
Sep 5, 2026
Merged

Tell macOS operators talkback is not there, instead of failing quietly#242
iamfatness merged 1 commit into
mainfrom
feat/talkback-macos-gate

Conversation

@iamfatness

Copy link
Copy Markdown
Owner

The problem

engine-talkback.cpp is in ENGINE_SOURCES, which only the Windows engine target uses. The macOS engine is main-macos.mm and never compiles it. The dock is cross-platform and builds either way — so on macOS every cell, the Assign button and the probe were live controls sending commands nothing on the other end answers.

The change

One constant, kTalkbackPlatformSupported, feeds TalkbackDockSessionView::platform_supported, TalkbackDockKeyContext::platform_supported, and the two buttons that reach the engine directly.

Three decisions worth reviewing as decisions:

  • The #if defined(__APPLE__) lives at one call site and crosses into talkback-dock-state.h as a plain bool. That header is Qt/OBS-free, so the macOS rendering is pinned by a Windows or Linux CI run — otherwise a macOS-only branch is tested by nothing this project runs.
  • BannerState::Unavailable is checked first and returns. That is what keeps the "coming to macOS" wording out of the ON AIR strip structurally: with no talkback engine nothing can key, so nothing can be live, and Unavailable and Live are unreachable together by construction rather than by promise.
  • In the key chain the gate sits directly below held_here and nowhere else. Never disabling a button the operator is holding is the stronger law (a disabled QPushButton drops down without emitting released(), stranding the key), and honouring it costs nothing here because there is no key to hold.

The layout instrument (COREVIDEO_TALKBACK_LAYOUT_TEST) is deliberately not gated — its job is rendering every state including the tallest live banner, and gating it would collapse it to the Unavailable strip on the platform a developer is most likely running it on.

Verification

Tests were written first and failed to compile, which was the point. Both halves mutation-proved: stubbing either gate to false fails the new assertions. A default-constructed context must stay supported, or the gate would turn talkback off on Windows — that one is easy to lose in a refactor, since every other test constructs its context explicitly.

271 targets built, 67/67 ctest green on macOS arm64. CLAUDE.md updated.

🤖 Generated with Claude Code

…f failing quietly

engine-talkback.cpp is in ENGINE_SOURCES, which only the Windows engine target
uses; the macOS engine is main-macos.mm and never compiles it. The dock is
cross-platform and builds either way, so on macOS every cell, the Assign button
and the probe were live controls sending commands nothing answers.

One constant, kTalkbackPlatformSupported, feeds both dock-state structs and the
two buttons that reach the engine directly.

Three decisions worth stating. The #if defined(__APPLE__) lives at that one
call site and crosses into talkback-dock-state.h as a plain bool, because that
header is Qt/OBS-free -- so the macOS rendering is pinned by a Windows or Linux
CI run, which is the only way a macOS-only branch gets tested by anything this
project runs. BannerState::Unavailable is checked first and returns, which is
what keeps the "coming to macOS" wording out of the ON AIR strip structurally:
with no talkback engine nothing can key, so nothing can be live, and Unavailable
and Live are unreachable together by construction rather than by promise. In the
key chain the gate sits directly below held_here and nowhere else -- never
disabling a button the operator is holding is the stronger law, and honouring it
costs nothing here because there is no key to hold.

The layout instrument (COREVIDEO_TALKBACK_LAYOUT_TEST) is deliberately NOT
gated: its job is to render every state including the tallest live banner, and
gating it would collapse it to the Unavailable strip on the platform a developer
is most likely running it on.

Tests written first (they failed to compile, which is the point). Both halves
mutation-proved: stubbing either gate to `false` fails the new assertions, and a
default-constructed context must stay supported or the gate would turn talkback
off on Windows. 67/67 ctest green on macOS arm64.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@iamfatness
iamfatness merged commit c41f7a4 into main Sep 5, 2026
13 checks passed
@iamfatness
iamfatness deleted the feat/talkback-macos-gate branch September 5, 2026 14:07
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