Render panel header icons through the resolved-icon path (#8352)

Closed
IT
2mo ago
+164-9

Summary

  • What changed? Markdown viewer and file preview header controls (typography/font size, refresh, preview/text toggle, copy as Markdown/HTML, revert, save, open-externally) and the header's leading file icon now render through CmuxResolvedIconImage / CmuxResolvedIconRenderer — the explicit-bitmap-context path introduced in #7729 that verifies the drawn output contains visible pixels and re-renders on appearance changes. Previously PanelHeaderIconGlyph drew a shared, cached template NSImage via SwiftUI Image(nsImage:).renderingMode(.template).
  • Why? Another surface of #8352 / #7725 / #4476: on macOS 15, template-image tinting intermittently rasterizes fully transparent while the buttons stay laid out and clickable (reported in the markdown preview header on macOS 15.6). The glyph tint is now always an explicit NSColor: the panel's theme foreground threaded down via a panelHeaderIconTint environment key from PanelFilePathHeader (the NSView-backed icon resolves the window appearance, not the panel's SwiftUI colorScheme override), falling back to secondaryLabelColor. Disabled buttons keep the color at reduced alpha.

Testing

  • How did you test this change? Added cmuxTests/PanelHeaderIconGlyphTests.swift (Swift Testing): request construction (symbol source, size, explicit tint, disabled-alpha, fallback tint), theme-tint derivation, and a parameterized test rendering every header symbol through CmuxResolvedIconRenderer under both aqua and darkAqua, asserting the renderer's visible-pixel verification succeeds. No red/green regression-commit pair: the underlying failure is an OS-level appearance-race during template rasterization that cannot be reproduced deterministically in CI; the renderer-level visibility test is the meaningful behavioral guard.
  • Localization audit: icon rendering only; no user-facing strings added or changed (all String(localized:) labels, help text, and accessibility labels untouched), so no Localizable.xcstrings or web message catalog changes.

Demo Video

Not available — see the Xcode toolchain limitation above; the fix targets an intermittent macOS 15 rasterization race that cannot be captured on demand.

  • Video URL or attachment: —

Review Trigger (Copy/Paste as PR comment)

@codex review
@coderabbitai review
@greptile-apps review
@cubic-dev-ai review

Checklist

  • I tested the change locally
  • I added or updated tests for behavior changes
  • I updated docs/changelog if needed (none needed)
  • I requested bot reviews after my latest commit (copy/paste block above or equivalent)
  • All code review bot comments are resolved
  • All human review comments are resolved

Fixes the markdown-preview-header surface of #8352 (related: #7725, #4476).

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Render all panel header icons through the resolved-icon path to prevent invisible glyphs on macOS 15. Fixes #8352 for markdown and file preview headers, including the leading file icon.

  • Bug Fixes
    • Route PanelHeaderIconGlyph and the header’s leading icon through CmuxResolvedIconImage/CmuxResolvedIconRenderer with visible-pixel verification and appearance re-rendering.
    • Apply explicit tints from the panel theme via a panelHeaderIconTint environment value, falling back to secondaryLabelColor; disabled buttons reduce alpha.
    • Add PanelHeaderIconGlyphTests to validate request construction and ensure all header symbols render visibly in aqua and darkAqua.

Summary by CodeRabbit

  • Style
    • Updated panel header icons to follow the active theme and surrounding interface styling more consistently.
    • Improved icon tinting across light and dark appearances.
    • Disabled icons now appear with appropriately reduced emphasis.
    • Refined “Open With” and font picker controls to use contextual styling while preserving existing accessibility labels, help text, and behavior.