Fix macOS 15 blank icon rendering

Merged
AU
5mo ago
+1034-92

Closes #7725.
Related: #4476.

Summary

  • Added a shared AppKit icon renderer that resolves images inside a concrete NSAppearance, copies mutable NSImage sources before sizing/drawing, applies template tint during the render pass, and outputs non-template raster images.
  • Routed Files sidebar symbols and Finder/Workspace icons through the shared renderer so they redraw on window attachment and effective-appearance changes instead of depending on contentTintColor timing.
  • Routed Vault/session, Task Manager, TextBox submit action provider icons, and terminal tab/pane agent icons through the same rendered-image path.
  • Changed terminal tab agent icons to publish rendered PNG iconImageData first, with iconAsset only as a fallback when rendering fails, and resync those images on app/effective appearance changes.
  • Stopped RenderableSystemSymbol from permanently caching transient failed SF Symbol lookups.

Audited icon call sites

  • Files explorer rows: FileExplorerCellView folder/file system symbols and Finder NSWorkspace icons.
  • Files explorer header: folder/search system symbols.
  • Vault/right sidebar session surfaces: AgentIconImage in SessionIndexView for Claude, Codex, OpenCode, Grok, Rovo Dev, Antigravity, Hermes, and registration-provided asset names.
  • Task Manager agent rows: CmuxTaskManagerRowView.rowIcon agent asset names.
  • TextBox provider submit buttons and menus: Claude, Codex, OpenCode, Pi and custom asset-backed submit actions.
  • Terminal tab/pane agent icons: live, title-derived, restored, detached, Dock, respawn, and Cloud VM replacement paths for Claude, Codex, OpenCode, Pi/OMP, Grok, Rovo Dev, Antigravity, Hermes, and registered-agent icons.
  • Shared SF Symbol helpers: RenderableSystemSymbol cache behavior for workspace-group and surface-tab symbols.

Regression coverage

  • Commit 1 adds the failing deterministic regression for permanent negative SF Symbol renderability caching.
  • Commit 2 fixes the cache and adds behavior-level coverage for resolved AppKit icon rendering and terminal tab payload fallback behavior.
  • The runtime macOS 15 blanking is a transient AppKit/window-appearance timing failure, so I did not add a fake sleep/flaky UI test. The highest-value deterministic coverage verifies the shared render contract: non-template visible pixels under resolved appearances, rerender on effective appearance changes, PNG payload generation, and terminal icon data-vs-asset fallback.

Verification

  • swift test --package-path Packages/macOS/CmuxAppKitSupportUI
  • ./scripts/check-pbxproj.sh
  • ./scripts/lint-pbxproj-test-wiring.sh
  • git diff --check HEAD~2..HEAD
  • python3 scripts/swift_file_length_budget.py --base-ref origin/main

Localization

  • No new user-facing strings were added.
  • Audited touched Swift diffs for newly added String(localized:), Text, Button, Label, .help, and accessibility label/description call sites; none were introduced.
  • Resources/Localizable.xcstrings, web/messages/en.json, and web/messages/ja.json were not changed.

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


[!NOTE]
Medium Risk
Broad UI surface area (tabs, dock detach/attach, file explorer) with new appearance sync on launch and theme changes; changes are localized to icon rendering with tests, not auth or data paths.

Overview
Fixes blank icons on macOS 15 by introducing a shared appearance-resolved AppKit icon pipeline in CmuxAppKitSupportUI (CmuxResolvedIconRenderer, CmuxResolvedIconImageView, SwiftUI CmuxResolvedIconImage) that rasterizes SF Symbols, assets, and workspace icons under the current NSAppearance instead of relying on template contentTintColor timing.

Files explorer, session/task UI, TextBox submit actions, and terminal tab agent icons now use this path. Terminal/Dock tabs prefer rendered PNG iconImageData with iconAsset only as fallback; ResolvedIconAppearanceObserver re-syncs those tab icons when NSApplication.effectiveAppearance changes.

RenderableSystemSymbol negative SF Symbol lookups expire after 60s instead of being cached forever.

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


Summary by cubic

Fixes blank icons on macOS 15 by resolving and rasterizing small icons through a shared AppKit pipeline that draws into explicit bitmap contexts. Icons re-render on appearance changes, and terminal/Dock tabs prefer PNG icons across updates, restores, detach/attach, and VM replacements.

  • New Features

    • Added CmuxResolvedIconRenderer, CmuxResolvedIconImageView, and SwiftUI CmuxResolvedIconImage in CmuxAppKitSupportUI.
    • Launch-safe ResolvedIconAppearanceObserver refreshes icons on NSApplication.effectiveAppearance via AppDelegate sync.
    • Routed Files views, session/task rows, TextBox submit icons, and terminal tab/pane icons through the renderer; tabs now publish PNG iconImageData with iconAsset fallback.
  • Bug Fixes

    • Rasterize under the current NSAppearance, apply template tint during draw, output non-template images, and render via explicit bitmap contexts for stable pixels and PNGs.
    • Stricter render cache keys; re-render when source image pixels change; bounded negative SF Symbol cache with 60s retry for failed lookups.
    • Fixed observer actor isolation to avoid cross-actor UI access at launch and on theme changes.
    • Restored Codex submit button tint when using resolved asset icons.

Summary by CodeRabbit

  • New Features
    • Added appearance-aware resolved icon rendering (SwiftUI + AppKit) for file/folder icons, header icons, submit actions, task rows, and agent/dock/tab icons.
    • Icons now auto-sync on app startup and re-render when the effective appearance changes.
    • Supports optional tinting, symbol sizing/weight, and accessibility labels.
  • Bug Fixes
    • Improved icon syncing by updating both rendered image data and asset references during detach/reattach and agent/title updates.
    • Enhanced system symbol renderability caching to retry previously non-renderable results after a delay.
  • Tests
    • Added coverage for resolved rendering, appearance switching, PNG output, and negative renderability cache behavior.