Repository navigation
Keep update popover primary buttons legible when the popover is not key - #19161
teamleaderleo wants to merge 1 commit into
Conversation
The update popover usually opens without becoming the key window, so its .borderedProminent actions render in the inactive control state: AppKit draws the gray inactive bezel under the prominent label and "Install and Relaunch" shows as an empty gray box. Force the key control state on the popover's primary actions (Install and Relaunch, Allow, Restart Now, Download Latest Version), as the Cloud enablement buttons already do. Fixes #18687 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to The updater buttons are consistently covered by the new key-state style, with no concrete merge-blocking issue established. Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)✅ Passed checks (23 passed)Full details: Cmux Swiftui State Layout
✨ Finishing Touches 💡 2
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Seen on other PRs too (likely flaky): CI failed on
Failures:
Matched log linesNot re-run automatically: Written by |
|
Agents: |
Summary
The update popover's "Install and Relaunch" button showed as an empty gray box with no label (reported on 0.64.25, macOS 15.3.1, dark appearance; the screenshot shows Skip and Later fine and a blank gray bezel where the prominent button should be).
The popover usually opens without becoming the key window (the pill's main window keeps key), so SwiftUI renders its
.borderedProminentbuttons in the inactive control state. AppKit then draws the gray inactive bezel under the prominent label and the button all but disappears. This is the same failure the Cloud enablement buttons hit and fixed withcloudProminentButtonStyle()(#17127). Nothing in the popover or itsNSHostingControlleroverrides tint, foreground color, or color scheme.This adds
updatePrimaryButtonStyle()in CmuxUpdaterUI (.borderedProminentpluscontrolActiveState = .key) and uses it for every prominent button in the popover: Install and Relaunch (update available and detected background update), Allow (auto-update permission), Restart Now, and Download Latest Version (error view). The buttons now keep their accent bezel and white label whether or not the popover window is key.Fixes #18687
Testing
UpdatePrimaryButtonStyleTests(CmuxUpdaterUI package tests): hosts a probe under an explicit.inactivecontrol state in an offscreen window and checks the primary style hands its content.key, with a control test that the probe sees.inactivewithout the style. Runs in CI's swift-package lane; not run locally (no local Swift test runs on this machine).dogfood/scenarios) have no scenario that opens the update popover, so there is no CI screenshot of it; adding one would need driving the updater into the update-available state and is left out of this PR.Changelog
Fixed: The update popover's Install and Relaunch button no longer shows as a blank gray box
Proof
CI only; no tour covers the update popover.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes the update popover's "Install and Relaunch" button rendering as a blank gray box when the popover is not the key window.
The fix adds
updatePrimaryButtonStyle()inCmuxUpdaterUI, which applies.borderedProminentand forces the.keycontrol active state, matching the treatment already used for Cloud enablement buttons. All prominent buttons in the popover (Install and Relaunch, Allow, Restart Now, Download Latest Version) now use this style so their accent bezel and label stay visible regardless of window focus state.UpdatePrimaryButtonStyleTestscovering the key-state override and a control probe confirming the inactive state without the style.Written for commit de0044a. Summary will update on new commits.
Note
Low Risk
UI-only SwiftUI button styling in the updater popover with targeted unit tests; no auth, data, or update logic changes.
Overview
Fixes #18687: primary actions in the update popover (e.g. Install and Relaunch) no longer render as a blank gray box when the popover window is not key.
Adds
updatePrimaryButtonStyle()—.borderedProminentwithcontrolActiveStateforced to.keyso accent and label stay visible in the inactive-window case (same idea as Cloud’scloudProminentButtonStyle). UpdatePopoverView and UpdateErrorView swap.buttonStyle(.borderedProminent)for this helper on Install and Relaunch, Allow, Restart Now, and Download Latest Version.UpdatePrimaryButtonStyleTests assert the modifier overrides an explicit
.inactiveenvironment; a control test confirms inactive state is observed without the style.Reviewed by Cursor Bugbot for commit de0044a. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
UI Improvements
Tests