Repository navigation
Conversation
ReenigneArcher
left a comment
There was a problem hiding this comment.
Requesting changes for the light-menu-bar visibility regression described inline.
Validation: npm ci --ignore-scripts, npm run build, and all 217 web tests passed with the PR's locked dependencies. All four emitted macOS SVGs match their sources. XML parsing, ClangFormat, CMake lint with the shared workflow's options, and git diff --check passed. A focused Qt 6.11.2 probe confirmed that the four icons load successfully but remain white, non-template images.
Verification limits: the full native Sunshine build and test_sunshine suite were not run. CI, common lint, and CodeQL workflows await maintainer approval. The head was rechecked at 463f2ebb21bb213e0254c0a47e92f68ccfb82ea4; GitHub reports it mergeable, and the latest target retains the original colored-icon behavior.
Review completed by Codex | Model: gpt-6.1-sol | Thinking: xhigh
| */ | ||
| #define TRAY_ICON WEB_DIR "images/logo-sunshine.svg" | ||
| #ifdef __APPLE__ | ||
| #define TRAY_ICON WEB_DIR "images/macos-tray-sunshine.svg" |
There was a problem hiding this comment.
[P2] Enable macOS template rendering before selecting white-only icons
On a light menu bar (for example, Light appearance with Reduce Transparency enabled), this unconditionally replaces the visible colored icon with white artwork. The pinned tray backend's QtTrayMenu::lookupIcon() returns an ordinary QIcon and never calls setIsMask(true). Qt's Cocoa tray implementation sets the native image's template flag from icon.isMask(), so AppKit keeps these icons white. All four SVGs produced isMask=false and exclusively white visible pixels in a Qt 6.11.2 probe; compositing them over a light background leaves almost no contrast. The limitation noted in the PR description therefore regresses icon and streaming-state visibility for light-menu-bar users.
Please ship template handling together with this asset switch, covering both tray initialization and updates. For example, this scoped change in the file-backed branch of QtTrayMenu::lookupIcon() in third-party/tray/src/QtTrayMenu.cpp marks these assets as templates:
if (auto result = QIcon(icon); !result.isNull()) {
#if defined(__APPLE__)
if (icon.section('/', -1).startsWith("macos-tray-")) {
result.setIsMask(true);
}
#endif
return result;
}A tray dependency change also needs the corresponding submodule revision update here. The flag-setting expression was compiled and verified in the focused Qt probe; the full Sunshine application was not built. Please validate light and dark menu bars after initialization and after a streaming-state change; the new path-string test cannot catch this rendering regression.
Review completed by Codex | Model: gpt-6.1-sol | Thinking: xhigh
There was a problem hiding this comment.
Thanks for the detailed guidance!
- Template image handling has been submitted to LizardByte/tray in fix(macos): enable template rendering for monochrome tray icons LizardByte/tray#218, adding
result.setIsMask(true)formacos-tray-*assets. - The
third-party/traysubmodule revision in this PR has been updated to point to that commit. - Verified on macOS that all four states (idle, streaming, paused, pairing) render in dark/black with crisp contrast on light/white menu bars and in white on dark menu bars. Individual screenshots for both light and dark appearances have been added to the updated PR description using the official template.
There was a problem hiding this comment.
Rechecked at c5132946. The updated gitlink points to tray ba93bc3b (LizardByte/tray#218), where lookupIcon() sets isMask for the macOS-specific filenames before both initial tray construction and subsequent icon updates. That addresses the missing-template mechanism identified here. I also inspected the eight supplied screenshots: all four states are visible as dark icons on the light background and white icons on the darker background.
My independent checks: all 217 web tests passed, the Linux web build passed, and git diff --check passed for this revision. The added native test checks the four selected asset paths; it does not itself verify Cocoa template rendering. I don't have a macOS environment here, so the live appearance/state-transition evidence remains the contributor's testing, not an independent native validation.
Please merge the tray dependency first and, if its merged commit differs (for example after squash), update this gitlink to that upstream commit. CI, lint and CodeQL for both current heads still await workflow approval. I found no additional concrete blocker in this focused re-review.
Review completed by Codex | Model: unavailable | Thinking: unavailable
There was a problem hiding this comment.
Correction to my proposed implementation and follow-up: the contrast problem is real, but I was too prescriptive in suggesting a Sunshine filename-prefix rule inside the shared tray library, and then asking for that dependency to be merged. Please don't treat that particular library change as required by this review.
Tray #218 does not force template rendering for every consumer: it affects only file-backed icons on macOS whose basename starts with macos-tray-. However, that still makes Sunshine's asset naming convention shared-library policy, and the same lookup function also handles notification icons. The existing tray API doesn't expose a template flag for Sunshine to set directly.
The requirement here is to preserve icon/state visibility on both light and dark menu bars, not to mandate a dependency feature. Retaining the existing artwork avoids introducing this regression without changing tray. If adaptive monochrome artwork is retained, an explicit opt-in with unchanged defaults for other consumers is one possible design, subject to the tray maintainer's agreement, rather than a required scope expansion. My prior verification establishes the current fix's mechanism and the supplied screenshots' contrast, not that its shared-library API design should be accepted.
Review completed by Codex | Model: unavailable | Thinking: unavailable
There was a problem hiding this comment.
I opened LizardByte/tray#219 for the explicit opt-in and updated this PR to use it on the macOS menu bar. The new regression checks cover the active template flag after initialization and state changes, along with colored notification artwork.
|
Please update the PR description to use the SunshineStream organization PR template. Preserve all sections and HTML comments, including Type of Change, Checklist, and AI Usage, and complete the applicable fields. Since this changes the menu bar UI, please include screenshots in the Screenshot section. Your existing summary and validation details can go under Description and Testing; sections that do not apply may remain empty and their boxes unchecked. Review completed by Codex | Model: gpt-6.1-sol | Thinking: xhigh |
|
@kjm0202 Now that LizardByte/tray#219 has merged, could you please update the |
|
Updated |
| #ifdef __APPLE__ | ||
| constexpr std::array notification_icons { | ||
| WEB_DIR "images/logo-sunshine.svg", | ||
| TRAY_ICON_LOCKED, |
There was a problem hiding this comment.
How come this one icon doesn't have a macOS version?
There was a problem hiding this comment.
Good point! appears to be used only for the system notification popup when a pairing request arrives, rather than as a menu bar icon.
Since it's used for notifications, the existing colored artwork remains highly visible and doesn't suffer from the contrast issues we see on the menu bar. Given the goal of this PR was specifically to improve the menu bar icon visibility using template rendering, I omitted this one.
Would you prefer I add a monochrome version for this notification icon as well to maintain consistency?
There was a problem hiding this comment.
That makes sense. We should probably add the monochrome version with this PR just in case we decide to use it in the tray in the future.
There was a problem hiding this comment.
That makes sense. I agree that keeping it consistent is better for future-proofing. I'll add the monochrome version of the locked icon in this PR and update the macOS pathing accordingly.
|



Description
Use native template rendering for Sunshine's idle, streaming, paused, and pairing menu bar icons on macOS so the artwork adapts to light and dark backgrounds. Sunshine requests
TRAY_OPTION_TEMPLATE_ICONwhen it initializes the tray, andtrayapplies the option on each icon update.Pairing notifications use the existing colored artwork. A pairing request shows the colored lock in its notification and uses the idle artwork in the menu bar.
The
third-party/traysubmodule is pinned toc7b35bb6e3d32b5ce03ce9ef14c25cc178927b2eon upstreammaster, which includes the merged opt-in API from LizardByte/tray#219.Screenshot
These captures show the same three template assets in the earlier prototype.
Issues Fixed or Closed
Roadmap Issues
Testing
test_sunshinewith macOS SDK 27.2 and Qt 6.12.0.test_sunshinepassed 844 tests with 8 environment-dependent skips. The 11 macOS tray tests passed, including the state transition and screenshot tests. The state transition checks verify the active tray icon's template flag and the colored notification artwork.npm testpassed 217 tests. The web build emitted the three macOS menu bar SVGs, and their bundled copies match the sources.git diff --checkpassed.trayrevision with the Sunshine build and all 11 macOS tray tests. Its file tree matches the previously tested review commit.Type of Change
Checklist
AI Usage
See our AI usage policy.