Modernize for macOS 14 + preserve Touch Bar copy icon tinting - #245
Conversation
The IconImage view fell back to loading custom SVG copies of SF Symbols from the asset catalog on macOS < 11 (see the 'fix: move to mac 11' commit). Now that the deployment target is macOS 14, IconImage always uses Image(systemName:), leaving the entire Assets.xcassets/Icons/ folder as dead fallback assets. Delete the 12 hand-drawn icon imagesets and modernize the one remaining consumer — the Touch Bar copy button — to load doc.on.doc directly from SF Symbols via NSImage(systemSymbolName:accessibilityDescription:). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FD1HGdhvposK8kYH2em6c3
Replace SwiftUI view modifiers that Apple deprecated at or below the new macOS 14 deployment floor with their modern equivalents. Behaviour is unchanged; the codebase was already partially migrated, so this brings the remaining stragglers in line: - .foregroundColor(_:) -> .foregroundStyle(_:) (56 sites) - .cornerRadius(_:) -> .clipShape(.rect(cornerRadius:)) (3 sites) - .edgesIgnoringSafeArea(.all) -> .ignoresSafeArea() (4 sites) - .accentColor(_:) -> .tint(_:) (1 site) The ColorPair.foregroundColor / .backgroundColor properties are untouched; only the SwiftUI modifier form was migrated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FD1HGdhvposK8kYH2em6c3
The macOS 14 modifier migration changed .foregroundColor to .foregroundStyle on the compliance footer, but the ternary 'isCompliant ? .primary : .secondary.opacity(0.5)' no longer type-checks: under .foregroundStyle the branches resolve to HierarchicalShapeStyle, and .opacity(0.5) yields a differently-typed 'some ShapeStyle', so the two arms disagree. Pin both branches to Color so they unify, matching the pre-migration behaviour. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
.accentColor is not a member of ShapeStyle (unlike .primary/.secondary/ .white/.black, which SwiftUI provides via ShapeStyle extensions), so the macOS 14 migration to .foregroundStyle/.tint broke every site that passed a bare .accentColor. Qualify these as Color.accentColor across NavigationMenu, ColorHistoryDrawer, HelpView, and SplashView. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The deleted doc.on.doc asset set template-rendering-intent: template, which let AppKit auto-tint the Touch Bar copy glyph to match the dark background. NSImage(systemSymbolName:accessibilityDescription:) does not guarantee isTemplate on macOS, so set it explicitly to keep the icon adapting as before. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WfkE8HKafLHRo2knFLeX5x
|
@claude Review please. |
Code ReviewReviewed the full diff — the macOS 14 modifier migration plus the Touch Bar fix. No correctness issues found. This is a clean, mechanical modernization and the risky spots are all handled correctly.
Touch Bar Deleted assets — verified genuinely dead: Note: the 🤖 Generated with Claude Code Generated by Claude Code |
Summary
Builds on the macOS 14 modernization work from #242 and addresses the review feedback flagged there.
Changes
Remove dead pre-macOS-11 SF Symbol fallback icons
IconImageused to fall back to hand-drawn SVG copies of SF Symbols on macOS < 11. With the deployment target at macOS 14,IconImagealways usesImage(systemName:), leavingAssets.xcassets/Icons/as dead fallback assets. Deletes the unused imagesets and updates the Touch Bar copy button to loaddoc.on.docfrom SF Symbols directly.Modernize deprecated SwiftUI modifiers for macOS 14
.foregroundColor(_:)→.foregroundStyle(_:).cornerRadius(_:)→.clipShape(.rect(cornerRadius:)).edgesIgnoringSafeArea(.all)→.ignoresSafeArea().accentColor(_:)→.tint(_:)Preserve Touch Bar copy icon tinting (review fix)
The deleted
doc.on.docasset settemplate-rendering-intent: template, which let AppKit auto-tint the Touch Bar copy glyph to match the dark background.NSImage(systemSymbolName:accessibilityDescription:)does not guaranteeisTemplateon macOS, so the replacement now setsisTemplate = trueexplicitly to keep the icon adapting as before.Test plan
🤖 Generated with Claude Code
Generated by Claude Code