Modernize for macOS 14: drop dead fallback icons and deprecated SwiftUI modifiers - #242
Modernize for macOS 14: drop dead fallback icons and deprecated SwiftUI modifiers#242superhighfives wants to merge 4 commits into
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>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
|
@claude Review please. |
|
Claude finished @superhighfives's task in 3m 10s —— View job Code Review
Overall this is a clean, mechanical modernization pass, and the diff matches the PR description well. The One issue worth checking before merge: Touch Bar copy button icon may lose template tinting — image: NSImage(systemSymbolName: "doc.on.doc", accessibilityDescription: nil)!,The asset this replaces ( Minor/non-blocking notes:
|
|
Addressed the flagged Touch Bar copy button template tinting issue. The deleted func createTouchBarCopyButton(action: Selector) -> NSButton? {
let image = NSImage(systemSymbolName: "doc.on.doc", accessibilityDescription: nil)!
image.isTemplate = true
let button = NSButton(
image: image,
target: nil,
action: action
)
button.widthAnchor.constraint(equalToConstant: 35).isActive = true
return button
}This keeps the icon adapting exactly as the old template asset did, preserving the "behaviour is unchanged" guarantee. Fix pushed in #245. 🤖 Generated with Claude Code Generated by Claude Code |
Summary
Two cleanup commits that take advantage of Pika's macOS 14 deployment floor to drop dead compatibility code and modernize deprecated SwiftUI APIs. Behaviour is unchanged throughout.
Changes
Remove dead pre-macOS-11 SF Symbol fallback icons
IconImageused to fall back to hand-drawn SVG copies of SF Symbols from the asset catalog on macOS < 11. With the deployment target now at macOS 14,IconImagealways usesImage(systemName:), leaving the entireAssets.xcassets/Icons/folder as dead fallback assets. This deletes the 12 unused imagesets and updates the one remaining consumer — the Touch Bar copy button — to loaddoc.on.docdirectly from SF Symbols viaNSImage(systemSymbolName:accessibilityDescription:).Modernize deprecated SwiftUI modifiers for macOS 14
Replaces SwiftUI modifiers Apple deprecated at or below the macOS 14 floor with their modern equivalents:
.foregroundColor(_:)→.foregroundStyle(_:)(56 sites).cornerRadius(_:)→.clipShape(.rect(cornerRadius:))(3 sites).edgesIgnoringSafeArea(.all)→.ignoresSafeArea()(4 sites).accentColor(_:)→.tint(_:)(1 site)The
ColorPair.foregroundColor/.backgroundColorproperties are untouched — only the SwiftUI modifier form was migrated.Test plan
🤖 Generated with Claude Code