Tell macOS operators talkback is not there, instead of failing quietly - #242
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
engine-talkback.cppis inENGINE_SOURCES, which only the Windows engine target uses. The macOS engine ismain-macos.mmand 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, feedsTalkbackDockSessionView::platform_supported,TalkbackDockKeyContext::platform_supported, and the two buttons that reach the engine directly.Three decisions worth reviewing as decisions:
#if defined(__APPLE__)lives at one call site and crosses intotalkback-dock-state.has 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::Unavailableis 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.held_hereand nowhere else. Never disabling a button the operator is holding is the stronger law (a disabledQPushButtondropsdownwithout emittingreleased(), 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
falsefails 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