From 49f3fb90a9f08bf960f42e269413399f87149042 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 27 Jan 2026 21:43:09 -0600 Subject: [PATCH] Signed-off-by: Matt Bruce --- Andromida/App/Views/History/HistoryView.swift | 8 +++++++- Andromida/App/Views/Insights/InsightsView.swift | 9 ++++++++- Andromida/App/Views/Rituals/RitualsView.swift | 7 ++++++- Andromida/App/Views/Settings/SettingsView.swift | 7 ++++--- Andromida/App/Views/Today/TodayView.swift | 7 ++++++- .../Views/Components/{LargeWidgetView.swift => ...swift} | 2 -- 6 files changed, 31 insertions(+), 9 deletions(-) rename AndromidaWidget/Views/Components/{LargeWidgetView.swift => ...swift} (98%) diff --git a/Andromida/App/Views/History/HistoryView.swift b/Andromida/App/Views/History/HistoryView.swift index c73c50f..6a45540 100644 --- a/Andromida/App/Views/History/HistoryView.swift +++ b/Andromida/App/Views/History/HistoryView.swift @@ -83,6 +83,11 @@ struct HistoryView: View { var body: some View { ScrollView(.vertical, showsIndicators: false) { VStack(alignment: .leading, spacing: Design.Spacing.large) { + if horizontalSizeClass == .regular { + Text(String(localized: "History")).styled(.heroBold) + .padding(.bottom, Design.Spacing.small) + } + // Ritual filter picker ritualPicker @@ -106,6 +111,7 @@ struct HistoryView: View { .id(refreshToken) } .padding(Design.Spacing.large) + .adaptiveContentWidth() } .background(LinearGradient( colors: [AppSurface.primary, AppSurface.secondary], @@ -113,7 +119,7 @@ struct HistoryView: View { endPoint: .bottomTrailing )) .navigationTitle(String(localized: "History")) - .navigationBarTitleDisplayMode(.large) + .navigationBarTitleDisplayMode(horizontalSizeClass == .regular ? .inline : .large) .toolbar { ToolbarItem(placement: .primaryAction) { if hasMoreHistory || monthsToShow > baseMonthsToShow { diff --git a/Andromida/App/Views/Insights/InsightsView.swift b/Andromida/App/Views/Insights/InsightsView.swift index a4c3ba2..c3acb68 100644 --- a/Andromida/App/Views/Insights/InsightsView.swift +++ b/Andromida/App/Views/Insights/InsightsView.swift @@ -4,6 +4,7 @@ import UniformTypeIdentifiers struct InsightsView: View { @Bindable var store: RitualStore + @Environment(\.horizontalSizeClass) private var horizontalSizeClass @State private var refreshToken = UUID() @State private var isEditing = false @State private var draggingCard: InsightCardType? @@ -29,6 +30,11 @@ struct InsightsView: View { NavigationStack { ScrollView(.vertical, showsIndicators: false) { VStack(alignment: .leading, spacing: Design.Spacing.large) { + if horizontalSizeClass == .regular { + Text(String(localized: "Insights")).styled(.heroBold) + .padding(.bottom, Design.Spacing.small) + } + // Grid with drag-and-drop support in edit mode LazyVGrid(columns: columns, spacing: Design.Spacing.medium) { ForEach(orderedCards) { card in @@ -44,6 +50,7 @@ struct InsightsView: View { } } .padding(Design.Spacing.large) + .adaptiveContentWidth() } .background(LinearGradient( colors: [AppSurface.primary, AppSurface.secondary], @@ -51,7 +58,7 @@ struct InsightsView: View { endPoint: .bottomTrailing )) .navigationTitle(String(localized: "Insights")) - .navigationBarTitleDisplayMode(.large) + .navigationBarTitleDisplayMode(horizontalSizeClass == .regular ? .inline : .large) .toolbar { ToolbarItem(placement: .primaryAction) { Button { diff --git a/Andromida/App/Views/Rituals/RitualsView.swift b/Andromida/App/Views/Rituals/RitualsView.swift index 44f505b..52fab82 100644 --- a/Andromida/App/Views/Rituals/RitualsView.swift +++ b/Andromida/App/Views/Rituals/RitualsView.swift @@ -37,6 +37,11 @@ struct RitualsView: View { var body: some View { ScrollView(.vertical, showsIndicators: false) { VStack(alignment: .leading, spacing: Design.Spacing.large) { + if horizontalSizeClass == .regular { + Text(String(localized: "Rituals")).styled(.heroBold) + .padding(.bottom, Design.Spacing.small) + } + // Segmented picker Picker(String(localized: "View"), selection: $selectedTab) { ForEach(RitualsTab.allCases, id: \.self) { tab in @@ -63,7 +68,7 @@ struct RitualsView: View { endPoint: .bottomTrailing )) .navigationTitle(String(localized: "Rituals")) - .navigationBarTitleDisplayMode(.large) + .navigationBarTitleDisplayMode(horizontalSizeClass == .regular ? .inline : .large) .toolbar { ToolbarItem(placement: .primaryAction) { Menu { diff --git a/Andromida/App/Views/Settings/SettingsView.swift b/Andromida/App/Views/Settings/SettingsView.swift index 76daa55..6a92730 100644 --- a/Andromida/App/Views/Settings/SettingsView.swift +++ b/Andromida/App/Views/Settings/SettingsView.swift @@ -3,6 +3,7 @@ import Bedrock struct SettingsView: View { @Bindable var store: SettingsStore + @Environment(\.horizontalSizeClass) private var horizontalSizeClass var ritualStore: RitualStore? var categoryStore: CategoryStore? @@ -168,8 +169,8 @@ struct SettingsView: View { Spacer(minLength: Design.Spacing.xxxLarge) } - .padding(.horizontal, Design.Spacing.large) - .adaptiveContentWidth(maxWidth: Design.Size.maxContentWidthPortrait) + .padding(Design.Spacing.large) + .adaptiveContentWidth() } .onAppear { store.refresh() @@ -180,7 +181,7 @@ struct SettingsView: View { } .background(AppSurface.primary) .navigationTitle(String(localized: "Settings")) - .navigationBarTitleDisplayMode(.large) + .navigationBarTitleDisplayMode(horizontalSizeClass == .regular ? .inline : .large) } } diff --git a/Andromida/App/Views/Today/TodayView.swift b/Andromida/App/Views/Today/TodayView.swift index 29d7e91..5587730 100644 --- a/Andromida/App/Views/Today/TodayView.swift +++ b/Andromida/App/Views/Today/TodayView.swift @@ -39,6 +39,11 @@ struct TodayView: View { var body: some View { ScrollView(.vertical, showsIndicators: false) { VStack(alignment: .leading, spacing: Design.Spacing.large) { + if horizontalSizeClass == .regular { + TodayHeaderView(dateText: store.todayDisplayString) + .padding(.bottom, Design.Spacing.small) + } + if todayRituals.isEmpty { if hasRitualsButNotNow { // Has active rituals but none for current time of day @@ -75,7 +80,7 @@ struct TodayView: View { endPoint: .bottomTrailing )) .navigationTitle(String(localized: "Today")) - .navigationBarTitleDisplayMode(.large) + .navigationBarTitleDisplayMode(horizontalSizeClass == .regular ? .inline : .large) .sheet(isPresented: .init( get: { showRenewalSheet }, set: { if !$0 { store.dismissRenewalPrompt() } } diff --git a/AndromidaWidget/Views/Components/LargeWidgetView.swift b/AndromidaWidget/Views/Components/...swift similarity index 98% rename from AndromidaWidget/Views/Components/LargeWidgetView.swift rename to AndromidaWidget/Views/Components/...swift index 585b2e8..fc4db36 100644 --- a/AndromidaWidget/Views/Components/LargeWidgetView.swift +++ b/AndromidaWidget/Views/Components/...swift @@ -33,7 +33,6 @@ struct LargeWidgetView: View { .background(AppTextColors.primary.opacity(0.2)) if entry.nextHabits.isEmpty { - Spacer() WidgetEmptyStateView( iconSize: .section, title: String(localized: "No rituals scheduled for \(entry.currentTimeOfDay.lowercased())."), @@ -43,7 +42,6 @@ struct LargeWidgetView: View { nextRitual: entry.nextRitualInfo, isCompact: false ) - Spacer() } else { Text(String(localized: "Habits")) .styled(.captionEmphasis, emphasis: .custom(AppTextColors.secondary))