diff --git a/Where/WhereUI/Sources/Primary/PrimaryView.swift b/Where/WhereUI/Sources/Primary/PrimaryView.swift index 807cdcf1..b60fe931 100644 --- a/Where/WhereUI/Sources/Primary/PrimaryView.swift +++ b/Where/WhereUI/Sources/Primary/PrimaryView.swift @@ -10,7 +10,7 @@ struct PrimaryView: View { @State private var showingCalendar = false @State private var calendarFocus: CalendarFocus? - /// Drives the passport's tilt-reactive holographic sheen. Started/stopped + /// Drives the region cards' tilt-reactive holographic sheen. Started/stopped /// with the view's lifecycle; a no-op on hardware without device motion. @State private var tilt = TiltProvider() @@ -25,45 +25,41 @@ struct PrimaryView: View { var body: some View { NavigationStack { - VStack(spacing: 0) { - PassportMasthead(title: Strings.primaryTitle, tilt: tilt) - .padding(.horizontal) - .padding(.top, UIConstants.Spacings.small) - .padding(.bottom, UIConstants.Spacings.medium) - - screen - } - .background(elevatedBackground) - .environment(\.colorScheme, .dark) - .navigationBarTitleDisplayMode(.inline) - .toolbarColorScheme(.dark, for: .navigationBar) - .toolbar { - ToolbarItem(placement: .topBarTrailing) { - Button { - showingTimeline = true - } label: { - Label( - Strings.primaryTimeline, - systemImage: "calendar.day.timeline.left", - ) + screen + .background(elevatedBackground) + .environment(\.colorScheme, .dark) + .navigationBarTitleDisplayMode(.inline) + .toolbarColorScheme(.dark, for: .navigationBar) + // Hide the bar's material so the glass cards scroll underneath + // the floating toolbar buttons rather than behind an opaque bar. + .toolbarBackground(.hidden, for: .navigationBar) + .toolbar { + ToolbarItem(placement: .topBarTrailing) { + Button { + showingTimeline = true + } label: { + Label( + Strings.primaryTimeline, + systemImage: "calendar.day.timeline.left", + ) + } + .accessibilityIdentifier("where_timeline_button") } - .accessibilityIdentifier("where_timeline_button") - } - ToolbarItem(placement: .topBarTrailing) { - Button { - showingCalendar = true - } label: { - Label( - Strings.primaryCalendar, - systemImage: "calendar", - ) + ToolbarItem(placement: .topBarTrailing) { + Button { + showingCalendar = true + } label: { + Label( + Strings.primaryCalendar, + systemImage: "calendar", + ) + } + .accessibilityIdentifier("where_calendar_button") + } + ToolbarItem(placement: .topBarTrailing) { + YearSelector(report: report) } - .accessibilityIdentifier("where_calendar_button") - } - ToolbarItem(placement: .topBarTrailing) { - YearSelector(report: report) } - } } .onAppear { tilt.start() } .onDisappear { tilt.stop() } @@ -166,68 +162,6 @@ struct PrimaryView: View { } } -/// The Primary tab's masthead: the app wordmark embossed in gold foil that -/// catches a moving specular glint as the device tilts, like the gilt title on -/// a passport cover. Falls back to a fixed, gentle highlight under Reduce -/// Motion or on hardware without device motion. -private struct PassportMasthead: View { - let title: String - var tilt: TiltProvider? - - @Environment(\.accessibilityReduceMotion) private var reduceMotion - - /// Lateral position of the glint, normalized `-1...1`. Pinned to a gentle - /// off-center value when motion is unavailable or reduced. - private var glintRoll: Double { - guard !reduceMotion, let roll = tilt?.roll else { return 0.2 } - return min(1, max(-1, roll)) - } - - var body: some View { - let wordmark = Text(verbatim: title.uppercased()) - .font(.system( - size: UIConstants.Size.mastheadFontSize, - weight: .heavy, - design: .serif, - )) - .tracking(2) - - return wordmark - .foregroundStyle(goldFoil) - .overlay { - LinearGradient( - colors: [.clear, .white.opacity(0.95), .clear], - startPoint: UnitPoint(x: glintRoll * 0.5 - 0.1, y: 0), - endPoint: UnitPoint(x: glintRoll * 0.5 + 0.6, y: 1), - ) - .blendMode(.plusLighter) - } - .mask { wordmark } - .shadow( - color: .black.opacity(0.45), - radius: UIConstants.Spacings.xSmall, - y: UIConstants.Spacings.xxSmall, - ) - .frame(maxWidth: .infinity, alignment: .leading) - .accessibilityAddTraits(.isHeader) - .accessibilityLabel(title) - } - - /// Brushed-gold gradient that reads as embossed gilt on the dark cover. - private var goldFoil: LinearGradient { - LinearGradient( - colors: [ - Color(red: 1.0, green: 0.93, blue: 0.7), - Color(red: 0.86, green: 0.66, blue: 0.32), - Color(red: 1.0, green: 0.9, blue: 0.66), - Color(red: 0.72, green: 0.52, blue: 0.24), - ], - startPoint: .top, - endPoint: .bottom, - ) - } -} - #if DEBUG #Preview("Loaded") { PrimaryView(report: PreviewSupport.loadedYearReportModel()) diff --git a/Where/WhereUI/Sources/Resources/Localizable.xcstrings b/Where/WhereUI/Sources/Resources/Localizable.xcstrings index bb60bb1c..6d12c219 100644 --- a/Where/WhereUI/Sources/Resources/Localizable.xcstrings +++ b/Where/WhereUI/Sources/Resources/Localizable.xcstrings @@ -766,17 +766,6 @@ } } }, - "primary.title" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Where" - } - } - } - }, "regionMap.empty.description" : { "extractionState" : "manual", "localizations" : { diff --git a/Where/WhereUI/Sources/Shared/Strings.swift b/Where/WhereUI/Sources/Shared/Strings.swift index 6304c1ca..69083026 100644 --- a/Where/WhereUI/Sources/Shared/Strings.swift +++ b/Where/WhereUI/Sources/Shared/Strings.swift @@ -61,11 +61,6 @@ enum Strings { // MARK: Primary - /// The Primary tab's masthead wordmark. - static var primaryTitle: String { - localized("primary.title") - } - static var primaryTimeline: String { localized("primary.timeline") } diff --git a/Where/WhereUI/Sources/Shared/UIConstants.swift b/Where/WhereUI/Sources/Shared/UIConstants.swift index 9245075c..d080b180 100644 --- a/Where/WhereUI/Sources/Shared/UIConstants.swift +++ b/Where/WhereUI/Sources/Shared/UIConstants.swift @@ -55,8 +55,6 @@ enum UIConstants { /// Point size of the oversized region glyph watermarked behind a card. static let stampWatermark: CGFloat = 150 static let stampWatermarkCompact: CGFloat = 96 - /// Point size of the Primary tab's gold-foil "Where" masthead. - static let mastheadFontSize: CGFloat = 52 /// Height of the map header on the Elsewhere region drill-in. static let regionMapHeight: CGFloat = 220 /// Upper bound for a picker-grid thumbnail edge; the actual size flexes diff --git a/Where/WhereUI/Tests/StringsTests.swift b/Where/WhereUI/Tests/StringsTests.swift index de6203ee..283d2508 100644 --- a/Where/WhereUI/Tests/StringsTests.swift +++ b/Where/WhereUI/Tests/StringsTests.swift @@ -8,7 +8,6 @@ import WhereCore struct StringsTests { @Test func simpleKeysResolveToCatalogValues() { #expect(Strings.tabElsewhere == "Elsewhere") - #expect(Strings.primaryTitle == "Where") #expect(Strings.loadErrorTitle == "Couldn't load your year") #expect(Strings.commonOK == "OK") #expect(Strings.manualSaveErrorTitle == "Couldn't save that day")