Repository navigation
Conversation
Surfaces per-session Brightness and Volume sliders directly in the menu bar status menu, so the receiver's real brightness/volume can be adjusted without opening the main window. Each slider pushes its value live to the existing session.brightness / session.volume path (already forwarded to the receiver), so it works reliably regardless of keyboard or input routing — no event taps, no cursor/media-key handling. Sliders appear only for connected sessions; the volume slider only when audio is enabled. Also tidies the menu: the verbose interface/IP and per-session status lines move into a "Connection info" submenu, keeping the default menu focused on the status summary, sliders, and actions. Localized en/it/de/zh. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
Author
aalpgiray
added a commit
to aalpgiray/targetBridge
that referenced
this pull request
Jul 29, 2026
Adds Control-Center-style toggles to the menu bar for the receiver's Night Shift and True Tone, and drops the volume slider — with an audio device selected, macOS's own Sound slider already drives the receiver's hardware volume, so a second control here can only disagree with the system one. Two-way: changing either on the receiver itself (Control Centre, System Settings) propagates back, so the toggles never show a stale state. ## Notes Both live in the private CoreBrightness framework, reached by dlopen and the Objective-C runtime — the same approach this app already uses for DisplayServices brightness — so a missing class or renamed selector degrades to "unsupported" rather than breaking the build or crashing on a future macOS. The receiver advertises supportsNightShift / supportsTrueTone in its profile and the toggles appear only when it does. CBTrueToneClient exposes both activate/deactivate and setEnabled:. The first pair looks like the on/off switch and is not — measured against the live framework, after deactivate the panel is unchanged and `enabled` still reports 1. They activate the client *session*. setEnabled: is the real switch, with activate/deactivate kept only as a fallback. One deliberately fragile spot: CBBlueLightClient has no `enabled` getter, only getBlueLightStatus:, which fills a private struct. It is read into an oversized zeroed buffer so a larger struct on a future macOS cannot overflow, and a changed layout misreports the toggle rather than crashing. ## Panel styling The panel was ~240 pt against Control Center's ~340 and the symbols were wrong. Width now comes from one constant; note the row width and the visible panel width differ, because a menu draws chrome around the item. Symbols were checked by rendering every plausible SF Symbol and comparing with Control Center rather than picking by name. Apple's family is half-circle -> half-sun -> full-sun for Dark Mode, Night Shift and True Tone, so Night Shift is a *sun with a dark half*, not a moon. True Tone's real glyph has lines through the disc and no SF Symbol does — Control Center appears to use a private asset — so sun.max.fill is the closest public match. The slider track stays grey, and the comment now records why: trackFillColor is set and menus ignore it, and overriding NSSliderCell.drawBar produces the accent fill but opts the cell out of AppKit's modern rendering, costing the knob its pressed-state translucency. A control that feels wrong beats one that looks plain. Accessibility: the slider carries its name (previously only its decorative glyphs did), the toggles use the checkbox role with a value that follows the state, and the captions are out of the accessibility tree rather than read as extra elements. Includes swellweb#143, which this builds on, rebased onto current main — that also required filling in the French labels it predates. Co-Authored-By: Claude Opus 5 <[email protected]>
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.


What
Adds Brightness and Volume sliders directly to the menu-bar status menu — one per connected session — so the receiver's real brightness/volume can be adjusted without opening the main window.
Why
The receiver already applies real brightness (
DisplayServicesSetBrightness) and volume, but today they're only reachable from the main window's session card. Surfacing them in the menu bar makes them a one-click adjustment — the same reliable, native-feeling pattern that apps like BetterDisplay / MonitorControl use (their own menu sliders), with none of the media-key / event-tap fragility.How
NSMenuItem(SF Symbol icon +NSSlider) whose value is pushed live tosession.brightness/session.volume, which already forward to the receiver. No event taps, no cursor/keyboard routing — it behaves identically regardless of external keyboards, Universal Control, etc.Contained entirely in
TBDisplaySenderStatusItemController.swift; no new files, no project changes.Testing
xcodebuild test(TBDisplaySender scheme): 72/72 pass.🤖 Generated with Claude Code