feat(home): custom SVG zone icons for body-zone cards #15
Reference in New Issue
Block a user
Delete Branch "feat/zone-card-icons"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Replaces the hand-drawn SwiftUI
Pathsilhouettes on the Home tab body-zone cards with polished vector SVG artwork — one distinct figure per zone (upper / lower / full body).Why
The previous
ZoneHighlightIcondrew a single sharedBodySilhouetteShapefor all three zones and differentiated them only by masking the upper / lower / full half with a gradient. The result: three near-identical blocky silhouettes that didn't read as distinct body zones. This ships proper artwork for each zone so the cards are immediately recognizable by shape alone.Changes
New assets —
Assets.xcassets/ZoneIcon{Upper,Lower,Full}.imageset/Three new imagesets, each with a custom SVG (
upper.svg,lower.svg,full.svg) and aContents.jsondeclaring:idiom: universal(single-scale),preserves-vector-representation: true→ Xcode keeps the SVG as crisp vector art at any size instead of rasterizing at build time.The SVGs use a shared design language: two hero colors (
#ff004awarm pink,#262bdfdeep indigo), with the warm accent positioned to encode the zone (top for upper, bottom for lower, both ends for full).Rewritten —
Views/Components/ZoneHighlightIcon.swiftBodySilhouetteShape(the hand-codedPathgeometry) and the inline zone→gradient switch.Image(decorative:)+.resizable().scaledToFit()in the existing 56×80 frame.ZoneHighlightIcon(zone: String).ZoneCardinHomeTab.swiftwas not touched.Files NOT changed
project.yml—Resourcesis already a folder reference; files insideAssets.xcassetsare picked up automatically onxcodegen generate.HomeTab.swift—ZoneCardcallsZoneHighlightIcon(zone:)unchanged.Theme.swift— untouched (the SVGs ship with their own baked-in colors and do not consumeTheme.zoneGradient).How to review
cd tabatago-swift && xcodegen generateTabataGoscheme (iOS simulator).Verification
xcodegen generatesucceedsxcodebuild build— BUILD SUCCEEDED under Swift 6 strict concurrency (SWIFT_STRICT_CONCURRENCY=complete)Notes / follow-ups
Theme.zoneGradientper card. If we later want the icons to auto-recolor to match the card background, ship single-color SVGs, set"template-rendering-intent": "template"in eachContents.json, and add.foregroundStyle(Theme.zoneGradient(zone))inZoneHighlightIcon. Out of scope for this PR.scaledToFit()preserves each SVG's native proportions, centering it with small side margins. Tunable later if needed.📱 Prêt à tester !
L'app est déployée sur l'iPhone (devicectl).