Repository navigation
Fix macOS 27 SF Symbol rasterization crash - #5999
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR replaces font-based SF Symbol sizing with an explicit Image.cmuxSymbolRasterSize helper that clamps raster point sizes to a minimum (1pt) and renders symbols via resizable+scaledToFit frames to avoid zero-size rasterization on macOS 27. ChangesSymbol Raster Size Migration via cmuxSymbolRasterSize
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 20 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (20 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Greptile SummaryIntroduces a shared
Confidence Score: 5/5Safe to merge — the change is a targeted, well-tested rasterization guard with no production logic side-effects beyond symbol frame sizing. The clamping logic is straightforward and fully covered by the new test suite (zero, negative, NaN, ±infinity). All identified crash-path call sites are migrated to the new helper. The narrowing of No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Image(systemName:)"] --> B["cmuxSymbolRasterSize(pointSize, weight)"]
B --> C["clampedRasterPointSize(pointSize)"]
C --> D{isFinite?}
D -- No --> E["return 1 (minimumRasterPointSize)"]
D -- Yes --> F["max(1, pointSize)"]
E --> G["rasterSize ≥ 1 pt"]
F --> G
G --> H[".resizable()"]
H --> I[".scaledToFit()"]
I --> J[".fontWeight(weight)"]
J --> K[".frame(rasterSize × rasterSize)"]
K --> L["Safe SwiftUI View — no 0×0 raster"]
style E fill:#f9f,stroke:#c33
style F fill:#9f9,stroke:#393
style L fill:#9cf,stroke:#369
Reviews (3): Last reviewed commit: "fix: address SF Symbol review feedback" | Re-trigger Greptile |
PRs included: - AppDelegate decomposition: CmuxSession session-snapshot repository (manaflow-ai#6030) - Fix Cmd+T cwd after session restore (manaflow-ai#6055) - Speed up iOS terminal scroll rendering (manaflow-ai#6035) - Preserve Pi sessions across workspace restore (manaflow-ai#5607) - Scope Biome checks to maintained JS sources (manaflow-ai#6008) - Fix manaflow-ai#5917: restore OSC 11 pane-local backgrounds (manaflow-ai#5997) - Expose stable window title templates (manaflow-ai#6059) - Honor macos-option-as-alt left/right - Fix macOS 27 SF Symbol rasterization crash (manaflow-ai#5999) - CmuxRemote* family: extract Workspace remote/cloud-VM connectivity - Fix iOS workspace swipe-delete confirmation crash (manaflow-ai#6051) - TabManager decomposition Wave 3+4 sub-models - Sidebar row cleanups: branchless frame anchor - CmuxIPCService: extract AppDelegate multi-window CLI routing - CmuxSidebarGit: extract TabManager git-metadata + PR-polling subsystem - CmuxTerminalCore: extract terminal core leaf Fork-side adjustments: - ghostty submodule: cherry-pick mouse-modifier-state fix onto our renderer-realized branch - Workspace.swift: take theirs (upstream extracted ~7700 lines into CmuxCore.Remote/CmuxRemoteSession packages); restore fork's renameTopLevelLayoutTabContaining/closeTopLevelLayoutTabContaining + surfaceTmuxClientTTYNames + WorkspaceLayoutTab integration - TabManager.swift: take theirs; re-add static allocatePortOrdinal() - BrowserPanelView, RenderableSystemSymbol: keep fork's cmuxSymbolPixelSize extension on top of upstream's cmuxSymbolRasterSize - Add CmuxWorkspaces / CMUXSessionDaemon / CmuxCommandPalette imports to TerminalController, Workspace, SessionPersistence - Sources/Workspace+P43Stubs.swift: thin shims for SplitEqualizer, WorkspaceRemoteSessionController.PortScanKickReason, WorkspaceGroupNewWorkspacePlacementSettings (legacy types fork TC still calls; replace with package APIs in P44+) - Sources/GhosttySurfaceSizeDeferralReason.swift: restore fork-only enum (deleted by upstream) - Sources/StableLayout/SessionBlueprintExportAction.swift: parked debug action (depends on legacy SessionPersistenceStore, gone) - Sources/GhosttyTerminalView.swift: stub ghostty_surface_select_cursor_line_compat (needs zig 0.15.2 xcframework rebuild) - pbxproj: keep-both, drop stale ProcessPipeReader/SplitEqualizer/Panels/BrowserProxyEndpoint refs, fix SurfaceHibernationPolicy UUID collision - Drop fork's WorkspaceRemoteConfiguration.swift + WorkspaceRemoteSSHBatchCommandBuilder.swift (extracted to CmuxCore package)
Summary
Image.cmuxSymbolRasterSizeguard that clamps SF Symbol raster frames to at least 1pt and sizes symbols withresizable().scaledToFit().frame(...)instead of transient font metricswrench.and.screwdriver, plus related browser toolbar/profile/theme icons, sidebar Help/metadata icons, right-sidebar header icons, and titlebar/update accessory iconsRoot cause
macOS 27 / CoreUI can reject SwiftUI SF Symbol rasterization when a font-sized symbol is laid out during a transient pre-visible/window layout pass and the target size collapses to 0x0. #5841 captured this for
wrench.and.screwdriverin the browser toolbar after cmd-clicking a terminal link. #5890 reports the same CoreUI/SwiftUI vector glyph throw during initial main-window bootstrap.This follows the #5670 precedent: use explicit positive symbol frames rather than relying on font metrics during those layout passes.
Reproduction
I did not fake a local repro: this machine is not on macOS 27, and the available evidence is the lldb/crash-report data in #5841 and #5890.
Tests
symbolRasterPointSizeClampsZeroAndNegativeInputsin the existing wiredWorkspaceGroupTests.swiftsuite.Fixes #5841
Fixes #5890
Refs #5670
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Prevents SF Symbol rasterization crashes on macOS 27 by clamping symbol sizes to at least 1 pt and sizing with explicit frames. Uses
Image.cmuxSymbolRasterSize(...)across the app to avoid 0×0 pre-layout sizes.RenderableSystemSymbol.clampedRasterPointSizeandImage.cmuxSymbolRasterSize(pointSize, weight)usingresizable().scaledToFit().frame(...).HeaderChromeIconStyle.symbol), titlebar controls, and notifications popover.cmuxFlatSymbolColorRenderingto anImageextension for consistent symbol pipelines.Written for commit 046cecc. Summary will update on new commits.
Summary by CodeRabbit
Refactor
Tests