Fix iOS unread count badge contrast

Merged
LA
4mo ago
+67-16

Summary

  • Make the iOS workspace back-button unread count badge use a fixed white circle with black text.
  • Avoid adaptive .primary/systemBackground colors for this badge because the toolbar sits over dark terminal chrome.

Verification

  • xcodebuildmcp swift-package build --package-path Packages/iOS/CmuxMobileShellUI --target-name CmuxMobileShellUI --configuration debug failed before compile because this worktree has no local GhosttyKit.xcframework.
  • ./ios/scripts/reload-cloud.sh --tag dog --device-id E4058DA9-F4C7-52DD-951D-0354061B8E89 --wait 1200 succeeded and installed dev.cmux.ios.dog on Lawrence’s iPhone.
  • ./scripts/reload-cloud.sh --tag dog succeeded and installed cmux DEV dog.app.
  • ./ios/scripts/reload.sh --tag dog --simulator "iPhone 17" --no-launch was blocked by the repo guard against local Xcode builds.
  • xcodebuildmcp device launch --device-id E4058DA9-F4C7-52DD-951D-0354061B8E89 --bundle-id dev.cmux.ios.dog launched successfully.

Dogfood

Open a workspace detail on iPhone with unread activity in another workspace. The back-button count should render as black text on a white circular badge over the dark terminal bar.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


[!NOTE]
Low Risk
Localized UI styling, CI cache hardening, and accessibility-aligned zoom behavior with unit tests; no auth, data, or security surface.

Overview
Fixes the iOS workspace back-button unread count badge so it stays readable over dark terminal toolbar chrome. The badge no longer uses adaptive .primary / systemBackground; it takes an explicit WorkspaceBackButtonBadgeContrast (.darkBackground → white circle + black text, .lightBackground → black circle + white text). WorkspaceShellView passes .darkBackground on the compact stack detail toolbar.

CI (swift-package-tests): After restoring GhosttyKit.xcframework, the workflow now checks for Info.plist, deletes a corrupt cache entry, and re-downloads when invalid (not only on cache miss). GhosttyKit package test failure handling renames the exit-status variable to test_status (behavior unchanged).

macOS canvas: Discrete keyboard/wheel zoom respects Reduce Motion via an injectable shouldReduceMotionForDiscreteZoom on CanvasRootView (skips animation and applies zoom immediately). CanvasViewportZoomTests stub that hook and add coverage for the reduce-motion path.

Reviewed by Cursor Bugbot for commit 1afa9c8625b3a08f1a0005b67b1aa67bdebd85da. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Fixes the iOS workspace back-button unread badge contrast with fixed black/white colors so the count stays readable over dark terminal chrome. Also hardens CI cache validation for GhosttyKit.xcframework and adds a Reduce Motion seam and tests for macOS discrete zoom.

  • New Features

    • Adds WorkspaceBackButtonBadgeContrast with .darkBackground (white badge, black text) and .lightBackground (black badge, white text; default).
    • WorkspaceShellView passes .darkBackground for the compact workspace toolbar.
  • Refactors

    • Moves WorkspaceBackButtonBadgeContrast into its own file.
    • CI: Validates cached GhosttyKit.xcframework by checking Info.plist and re-downloads when invalid.
    • macOS: Injects shouldReduceMotionForDiscreteZoom in CanvasRootView and adds tests to verify immediate zoom when Reduce Motion is on.

Summary by CodeRabbit

  • Style
    • Updated the workspace back button unread-count badge to use an explicit black/white contrast scheme instead of adaptive/primary-based tinting.
    • Added dedicated badge contrast presets for dark vs. light terminal chrome and applied them to badge fill and text for consistent readability.
  • Chores
    • Improved CI cache validation for a prebuilt framework by detecting missing metadata after restore and forcing a re-download when invalid.
    • Tightened the unit test runner’s failure handling for more reliable nonzero-exit behavior.