iPhone Duo (fase 1): navegación adaptativa por size class y layouts regular×regular

- ContentView: un único TabView (sidebarAdaptable en iOS 18+) para todas las
  size classes; desaparece el cambio de jerarquía iPhone/iPad, así abrir o
  cerrar el Duo conserva el estado de cada pestaña. @SceneStorage de la tab.
- Fuentes y Diario: NavigationSplitView (lista + detalle a la vez en ancho
  regular, stack colapsable en compacto) con selección nativa de List.
- Dashboard: Quick Update como .inspector (panel lateral junto a los gráficos
  en regular, sheet en compacto).
- Gráficos: chartHeightScale (+35% de alto en regular) vía chartFrame(height:),
  sin ignoresSafeArea en contenido interactivo.
- Liquid Glass (glassEffect) en las etiquetas flotantes del Diario en iOS 26+.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F1u4K16xy7eQVtgsYNZ9Vn
This commit is contained in:
alexandrev-tibco
2026-09-16 11:44:50 +02:00
parent a8a9ad64f3
commit 680255f69d
17 changed files with 485 additions and 547 deletions
@@ -77,7 +77,7 @@ struct DashboardView: View {
}
}
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
ToolbarItem(placement: .topBarTrailing) {
Button {
QuickUpdateTip().invalidate(reason: .actionPerformed)
showingQuickUpdate = true
@@ -86,7 +86,7 @@ struct DashboardView: View {
}
.popoverTip(QuickUpdateTip())
}
ToolbarItem(placement: .navigationBarTrailing) {
ToolbarItem(placement: .topBarTrailing) {
Button {
balancePrivacy.toggleHidden()
} label: {
@@ -94,10 +94,10 @@ struct DashboardView: View {
}
.accessibilityLabel(balancePrivacy.balancesHidden ? Text("Show balances") : Text("Hide balances"))
}
ToolbarItem(placement: .navigationBarTrailing) {
ToolbarItem(placement: .topBarTrailing) {
accountFilterMenu
}
ToolbarItem(placement: .navigationBarLeading) {
ToolbarItem(placement: .topBarLeading) {
Button {
showingCustomize = true
} label: {
@@ -143,10 +143,6 @@ struct DashboardView: View {
.sheet(isPresented: $showingCustomize) {
DashboardCustomizeView(configs: $sectionConfigs)
}
.sheet(isPresented: $showingQuickUpdate) {
QuickUpdateView()
.environment(\.managedObjectContext, CoreDataStack.shared.viewContext)
}
.sheet(isPresented: $viewModel.showingPaywall) {
PaywallView()
}
@@ -175,6 +171,18 @@ struct DashboardView: View {
if !viewModel.hasData { showingAddSource = true }
}
}
// Quick Update lives in an inspector: a trailing panel in regular width
// (iPad, iPhone Duo inner screen) so the dashboard charts stay visible
// while values are typed; the system presents it as a sheet in compact.
.inspector(isPresented: $showingQuickUpdate) {
QuickUpdateView()
.environment(\.managedObjectContext, CoreDataStack.shared.viewContext)
.environmentObject(iapService)
.environmentObject(accountStore)
.environmentObject(tabSelection)
.environmentObject(balancePrivacy)
.inspectorColumnWidth(min: 340, ideal: 400, max: 480)
}
}
private var accountFilterMenu: some View {
@@ -478,20 +486,20 @@ struct TotalValueCard: View {
HStack {
Text("Total Portfolio Value")
.font(.subheadline.weight(.medium))
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
Spacer()
if let onShareTap {
Button(action: onShareTap) {
Image(systemName: "square.and.arrow.up")
.font(.subheadline.weight(.semibold))
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
}
}
Text(totalValue)
.font(.system(size: 44, weight: .bold, design: .rounded))
.foregroundColor(.primary)
.foregroundStyle(.primary)
.minimumScaleFactor(0.6)
.lineLimit(1)
.hiddenBalance(balancesHidden)
@@ -503,7 +511,7 @@ struct TotalValueCard: View {
Text(changeText)
.font(.subheadline.weight(.semibold))
}
.foregroundColor(isPositive ? .positiveGreen : .negativeRed)
.foregroundStyle(isPositive ? Color.positiveGreen : Color.negativeRed)
.padding(.horizontal, 10)
.padding(.vertical, 5)
.background((isPositive ? Color.positiveGreen : Color.negativeRed).opacity(0.12))
@@ -511,7 +519,7 @@ struct TotalValueCard: View {
Text(changeLabel)
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
if sparklineData.count >= 2 {
@@ -544,10 +552,10 @@ struct TotalValueCard: View {
Image(systemName: "lock.fill").font(.caption2)
Text("12m forecast").font(.caption2)
}
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
Text("Unlock")
.font(.caption.weight(.semibold))
.foregroundColor(.appPrimary)
.foregroundStyle(Color.appPrimary)
}
.frame(maxWidth: .infinity)
}
@@ -559,17 +567,17 @@ struct TotalValueCard: View {
.padding(20)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color(.secondarySystemGroupedBackground))
.cornerRadius(AppConstants.UI.cornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
}
private func heroMetric(label: String, value: String, positive: Bool) -> some View {
VStack(spacing: 2) {
Text(label)
.font(.caption2)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
Text(value)
.font(.caption.weight(.semibold))
.foregroundColor(positive ? .positiveGreen : .negativeRed)
.foregroundStyle(positive ? Color.positiveGreen : Color.negativeRed)
}
.frame(maxWidth: .infinity)
}
@@ -760,15 +768,10 @@ struct MonthlyCheckInCard: View {
}
.padding(isMonthComplete ? 14 : 20)
.background(Color(.secondarySystemGroupedBackground))
.cornerRadius(AppConstants.UI.cornerRadius)
.background(
NavigationLink(isActive: $startDestinationActive) {
MonthlyCheckInView(referenceDate: navigationReferenceDate)
} label: {
EmptyView()
}
.opacity(0)
)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
.navigationDestination(isPresented: $startDestinationActive) {
MonthlyCheckInView(referenceDate: navigationReferenceDate)
}
// Calm 2.0 Fase 2: the ritual runs as a guided full-screen flow one
// source per step, reflection, closing summary.
.fullScreenCover(isPresented: $showingGuidedFlow) {
@@ -782,14 +785,14 @@ struct MonthlyCheckInCard: View {
HStack(spacing: 10) {
Image(systemName: "checkmark.seal.fill")
.font(.title3)
.foregroundColor(.positiveGreen)
.foregroundStyle(Color.positiveGreen)
VStack(alignment: .leading, spacing: 2) {
Text(String(format: String(localized: "checkin_done_title"), currentMonthLabel))
.font(.subheadline.weight(.semibold))
if let nextDate = nextCheckInDate {
Text(String(format: String(localized: "checkin_done_next"), nextDate.mediumDateString))
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
}
Spacer()
@@ -800,7 +803,7 @@ struct MonthlyCheckInCard: View {
Text("\(streak)")
.font(.caption.weight(.bold))
}
.foregroundColor(.orange)
.foregroundStyle(.orange)
.padding(.horizontal, 10)
.padding(.vertical, 5)
.background(Color.orange.opacity(0.12))
@@ -810,7 +813,7 @@ struct MonthlyCheckInCard: View {
Button(action: onShareSummary) {
Image(systemName: "square.and.arrow.up")
.font(.caption.weight(.semibold))
.foregroundColor(.appPrimary)
.foregroundStyle(Color.appPrimary)
}
.buttonStyle(.plain)
.accessibilityLabel(Text("Share monthly summary"))
@@ -820,7 +823,7 @@ struct MonthlyCheckInCard: View {
} label: {
Image(systemName: "chevron.right")
.font(.caption.weight(.semibold))
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
}
.contentShape(Rectangle())
@@ -836,7 +839,7 @@ struct MonthlyCheckInCard: View {
.font(.headline)
Text(currentMonthLabel)
.font(.subheadline)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
Spacer()
if streak >= 2 {
@@ -844,7 +847,7 @@ struct MonthlyCheckInCard: View {
Image(systemName: "flame.fill").font(.caption)
Text("\(streak)").font(.caption.weight(.bold))
}
.foregroundColor(.orange)
.foregroundStyle(.orange)
.padding(.horizontal, 10)
.padding(.vertical, 5)
.background(Color.orange.opacity(0.12))
@@ -867,7 +870,7 @@ struct MonthlyCheckInCard: View {
)
} label: {
Image(systemName: "calendar.badge.plus")
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
.font(.subheadline.weight(.semibold))
}
@@ -879,7 +882,7 @@ struct MonthlyCheckInCard: View {
.tint(progressBarTint)
Text(String(format: String(localized: "checkin_sources_progress"), updatedCount, totalSources))
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
} else {
ProgressView(value: checkInProgress)
@@ -890,15 +893,15 @@ struct MonthlyCheckInCard: View {
HStack(spacing: 6) {
Image(systemName: "calendar")
.font(.caption)
.foregroundColor(isOverdue ? .red : .secondary)
.foregroundStyle(isOverdue ? .red : .secondary)
Text(String(format: String(localized: "checkin_next_due"), nextDate.mediumDateString))
.font(.caption)
.foregroundColor(isOverdue ? .red : .secondary)
.foregroundStyle(isOverdue ? .red : .secondary)
Spacer()
if !deadlineBadgeText.isEmpty {
Text(deadlineBadgeText)
.font(.caption2.weight(.semibold))
.foregroundColor(progressBarTint)
.foregroundStyle(progressBarTint)
.padding(.horizontal, 8)
.padding(.vertical, 3)
.background(progressBarTint.opacity(0.12))
@@ -908,7 +911,7 @@ struct MonthlyCheckInCard: View {
.padding(.horizontal, 10)
.padding(.vertical, 8)
.background(Color(.tertiarySystemFill))
.cornerRadius(10)
.clipShape(RoundedRectangle(cornerRadius: 10))
}
Button {
@@ -919,8 +922,8 @@ struct MonthlyCheckInCard: View {
.frame(maxWidth: .infinity)
.padding(.vertical, 12)
.background(Color.appPrimary)
.foregroundColor(.white)
.cornerRadius(AppConstants.UI.cornerRadius)
.foregroundStyle(.white)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
}
.accessibilityIdentifier("checkin_start_cta")
}
@@ -962,11 +965,11 @@ struct MomentumStreaksCard: View {
if stats.totalCheckIns > 0 {
Text(String(format: NSLocalizedString("on_time_rate", comment: ""), onTimeRateText))
.font(.subheadline.weight(.semibold))
.foregroundColor(.appSecondary)
.foregroundStyle(Color.appSecondary)
} else {
Text("Log a check-in to start a streak")
.font(.subheadline)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
}
@@ -1002,7 +1005,7 @@ struct MomentumStreaksCard: View {
HStack {
Text("On-time score")
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
Spacer()
Text(
String(
@@ -1012,7 +1015,7 @@ struct MomentumStreaksCard: View {
)
)
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
if let closest = stats.closestCutoffDays {
@@ -1023,7 +1026,7 @@ struct MomentumStreaksCard: View {
)
)
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
if !stats.achievements.isEmpty && !compact {
@@ -1053,7 +1056,7 @@ struct MomentumStreaksCard: View {
Spacer()
Image(systemName: "chevron.right")
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
.padding(.vertical, 8)
.contentShape(Rectangle())
@@ -1062,7 +1065,7 @@ struct MomentumStreaksCard: View {
}
.padding()
.background(Color(.systemBackground))
.cornerRadius(AppConstants.UI.cornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
.shadow(color: .black.opacity(0.05), radius: 8, y: 2)
.onAppear(perform: refreshStats)
.onReceive(NotificationCenter.default.publisher(for: .NSManagedObjectContextObjectsDidChange)) { _ in
@@ -1097,14 +1100,14 @@ struct MomentumStreaksCard: View {
.lineLimit(1)
Text(title)
.font(.caption2)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
.lineLimit(1)
.minimumScaleFactor(0.8)
}
.frame(maxWidth: .infinity)
.padding(.vertical, 10)
.background(Color.gray.opacity(0.08))
.cornerRadius(AppConstants.UI.smallCornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.smallCornerRadius))
}
@ViewBuilder
@@ -1112,17 +1115,17 @@ struct MomentumStreaksCard: View {
VStack(alignment: .leading, spacing: 4) {
Text(title)
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
Text(value)
.font(.title3.weight(.semibold))
Text(subtitle)
.font(.caption2)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
.padding()
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.gray.opacity(0.08))
.cornerRadius(AppConstants.UI.smallCornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.smallCornerRadius))
}
@ViewBuilder
@@ -1130,18 +1133,18 @@ struct MomentumStreaksCard: View {
HStack(alignment: .top, spacing: 8) {
Image(systemName: achievement.icon)
.font(.headline)
.foregroundColor(.appSecondary)
.foregroundStyle(Color.appSecondary)
VStack(alignment: .leading, spacing: 2) {
Text(achievement.title)
.font(.caption.weight(.semibold))
Text(achievement.detail)
.font(.caption2)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
}
.padding(10)
.background(Color.appSecondary.opacity(0.12))
.cornerRadius(AppConstants.UI.smallCornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.smallCornerRadius))
}
private func formattedDaysText(for days: Double?) -> String {
@@ -1191,7 +1194,7 @@ struct MonthlySummaryCard: View {
VStack(alignment: .leading, spacing: 4) {
Text("Contributions")
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
Text(summary.formattedContributions)
.font(.subheadline.weight(.semibold))
.hiddenBalance()
@@ -1202,17 +1205,17 @@ struct MonthlySummaryCard: View {
VStack(alignment: .trailing, spacing: 4) {
Text("Net Performance")
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
Text("\(summary.formattedNetPerformance) (\(summary.formattedNetPerformancePercentage))")
.font(.subheadline.weight(.semibold))
.foregroundColor(summary.netPerformance >= 0 ? .positiveGreen : .negativeRed)
.foregroundStyle(summary.netPerformance >= 0 ? Color.positiveGreen : Color.negativeRed)
.hiddenBalance()
}
}
}
.padding()
.background(Color(.systemBackground))
.cornerRadius(AppConstants.UI.cornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
.shadow(color: .black.opacity(0.05), radius: 8, y: 2)
}
}
@@ -1233,7 +1236,7 @@ struct DashboardCustomizeView: View {
.font(.subheadline.weight(.semibold))
Text(config.isCollapsed ? "Compact" : "Expanded")
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
Spacer()
@@ -1256,10 +1259,10 @@ struct DashboardCustomizeView: View {
}
.navigationTitle("Customize Dashboard")
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
ToolbarItem(placement: .topBarLeading) {
EditButton()
}
ToolbarItem(placement: .navigationBarTrailing) {
ToolbarItem(placement: .topBarTrailing) {
Button("Done") {
DashboardLayoutStore.save(configs)
dismiss()
@@ -1286,18 +1289,18 @@ struct CompactCard: View {
if subtitleIsBalance {
Text(subtitle)
.font(.subheadline)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
.hiddenBalance()
} else {
Text(subtitle)
.font(.subheadline)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
}
.padding()
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color(.systemBackground))
.cornerRadius(AppConstants.UI.cornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
.shadow(color: .black.opacity(0.05), radius: 8, y: 2)
}
}
@@ -1312,7 +1315,7 @@ struct EvolutionCompactCard: View {
if let last = data.last {
Text(last.value.compactCurrencyString)
.font(.subheadline.weight(.semibold))
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
SparklineView(data: data, color: .appPrimary)
.frame(height: 40)
@@ -1320,7 +1323,7 @@ struct EvolutionCompactCard: View {
.padding()
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color(.systemBackground))
.cornerRadius(AppConstants.UI.cornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
.shadow(color: .black.opacity(0.05), radius: 8, y: 2)
}
}
@@ -1367,7 +1370,7 @@ struct PeriodReturnsCard: View {
}
.padding()
.background(Color(.systemBackground))
.cornerRadius(AppConstants.UI.cornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
.shadow(color: .black.opacity(0.05), radius: 8, y: 2)
}
}
@@ -1381,11 +1384,11 @@ struct ReturnPeriodView: View {
VStack(spacing: 4) {
Text(period)
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
Text(change)
.font(.subheadline.weight(.semibold))
.foregroundColor(isPositive ? .positiveGreen : .negativeRed)
.foregroundStyle(isPositive ? Color.positiveGreen : Color.negativeRed)
.lineLimit(1)
.minimumScaleFactor(0.8)
}
@@ -1404,14 +1407,14 @@ struct EmptyDashboardView: View {
VStack(spacing: 20) {
Image(systemName: "chart.pie")
.font(.system(size: 60))
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
Text("Welcome to Portfolio Journal")
.font(.custom("Avenir Next", size: 24).weight(.semibold))
Text("Start by adding your first investment source to track your portfolio.")
.font(.subheadline)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
Button {
@@ -1419,11 +1422,11 @@ struct EmptyDashboardView: View {
} label: {
Label("Add Investment Source", systemImage: "plus")
.font(.headline)
.foregroundColor(.white)
.foregroundStyle(.white)
.padding()
.frame(maxWidth: .infinity)
.background(Color.appPrimary)
.cornerRadius(AppConstants.UI.cornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
}
HStack(spacing: 12) {
@@ -1435,8 +1438,8 @@ struct EmptyDashboardView: View {
.frame(maxWidth: .infinity)
.padding()
.background(Color.appPrimary.opacity(0.1))
.foregroundColor(.appPrimary)
.cornerRadius(AppConstants.UI.cornerRadius)
.foregroundStyle(Color.appPrimary)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
}
Button {
@@ -1447,8 +1450,8 @@ struct EmptyDashboardView: View {
.frame(maxWidth: .infinity)
.padding()
.background(Color.appSecondary.opacity(0.1))
.foregroundColor(.appSecondary)
.cornerRadius(AppConstants.UI.cornerRadius)
.foregroundStyle(Color.appSecondary)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
}
}
}
@@ -1465,24 +1468,24 @@ struct PendingUpdatesAlertBanner: View {
var body: some View {
HStack(spacing: 10) {
Image(systemName: "exclamationmark.triangle.fill")
.foregroundColor(.white)
.foregroundStyle(.white)
Text("\(count) source\(count == 1 ? "" : "s") pending update")
.font(.subheadline.weight(.semibold))
.foregroundColor(.white)
.foregroundStyle(.white)
Spacer()
Button(action: onDismiss) {
Image(systemName: "xmark")
.font(.caption.weight(.bold))
.foregroundColor(.white.opacity(0.8))
.foregroundStyle(.white.opacity(0.8))
}
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
.background(Color.appWarning)
.cornerRadius(AppConstants.UI.cornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
}
}
@@ -1496,13 +1499,13 @@ struct PendingUpdatesCard: View {
VStack(alignment: .leading, spacing: 12) {
HStack {
Image(systemName: "bell.badge.fill")
.foregroundColor(.appWarning)
.foregroundStyle(Color.appWarning)
Text("Pending Updates")
.font(.headline)
Spacer()
Text("\(sources.count)")
.font(.subheadline)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
ForEach(sources.prefix(3), id: \.objectID) { source in
@@ -1519,11 +1522,11 @@ struct PendingUpdatesCard: View {
Text(source.latestSnapshot?.date.relativeDescription ?? "Never")
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
Image(systemName: "chevron.right")
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
}
.buttonStyle(.plain)
@@ -1532,12 +1535,12 @@ struct PendingUpdatesCard: View {
if sources.count > 3 {
Text("+ \(sources.count - 3) more")
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
}
.padding()
.background(Color(.systemBackground))
.cornerRadius(AppConstants.UI.cornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
.shadow(color: .black.opacity(0.05), radius: 8, y: 2)
}
}
@@ -1593,7 +1596,7 @@ struct GoalsSummaryCard: View {
Text(category.name)
.font(.caption2.weight(.semibold))
}
.foregroundColor(category.color)
.foregroundStyle(category.color)
}
}
HStack(spacing: 4) {
@@ -1601,22 +1604,22 @@ struct GoalsSummaryCard: View {
.font(.caption.weight(.semibold))
Text("of \(goal.targetDecimal.compactCurrencyString)")
.font(.caption)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
if let targetDate = goal.targetDate {
Text("Target: \(targetDate.mediumDateString)")
.font(.caption2.weight(.semibold))
.foregroundColor(targetUrgency == .critical ? .negativeRed : (targetUrgency == .warning ? .appWarning : .secondary))
.foregroundStyle(targetUrgency == .critical ? Color.negativeRed : (targetUrgency == .warning ? Color.appWarning : .secondary))
}
if let etaText = etaProvider(goal) {
Text(etaText)
.font(.caption2)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
if let paceStatus {
Text(paceStatus.statusText)
.font(.caption2.weight(.semibold))
.foregroundColor(paceStatus.isBehind ? .appWarning : .positiveGreen)
.foregroundStyle(paceStatus.isBehind ? Color.appWarning : Color.positiveGreen)
}
}
Spacer()
@@ -1630,14 +1633,14 @@ struct GoalsSummaryCard: View {
} label: {
Image(systemName: "square.and.arrow.up")
.font(.caption)
.foregroundColor(.appPrimary)
.foregroundStyle(Color.appPrimary)
}
}
}
}
.padding()
.background(Color(.systemBackground))
.cornerRadius(AppConstants.UI.cornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
.shadow(color: .black.opacity(0.05), radius: 8, y: 2)
}
}
@@ -1657,11 +1660,11 @@ struct EmptyGoalsCard: View {
}
Text("Add a milestone like 1M and track your progress each month.")
.font(.subheadline)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
.padding()
.background(Color(.systemBackground))
.cornerRadius(AppConstants.UI.cornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
.shadow(color: .black.opacity(0.05), radius: 8, y: 2)
}
}
@@ -1706,7 +1709,7 @@ struct ContributionsVsReturnsCard: View {
Circle().fill(Color.appSecondary).frame(width: 10, height: 10)
VStack(alignment: .leading, spacing: 2) {
Text(String(localized: "contributions_vs_returns_invested"))
.font(.caption).foregroundColor(.secondary)
.font(.caption).foregroundStyle(.secondary)
Text(totalContributions.currencyString)
.font(.subheadline.weight(.semibold))
}
@@ -1716,18 +1719,18 @@ struct ContributionsVsReturnsCard: View {
Circle().fill(isReturnPositive ? Color.positiveGreen : Color.negativeRed).frame(width: 10, height: 10)
VStack(alignment: .trailing, spacing: 2) {
Text(String(localized: "contributions_vs_returns_returns"))
.font(.caption).foregroundColor(.secondary)
.font(.caption).foregroundStyle(.secondary)
let prefix = totalReturns >= 0 ? "+" : ""
Text("\(prefix)\(totalReturns.currencyString)")
.font(.subheadline.weight(.semibold))
.foregroundColor(isReturnPositive ? .positiveGreen : .negativeRed)
.foregroundStyle(isReturnPositive ? Color.positiveGreen : Color.negativeRed)
}
}
}
}
.padding()
.background(Color(.systemBackground))
.cornerRadius(AppConstants.UI.cornerRadius)
.clipShape(RoundedRectangle(cornerRadius: AppConstants.UI.cornerRadius))
.shadow(color: .black.opacity(0.05), radius: 8, y: 2)
}
}