Files
InvestmentTrackerApp/PortfolioJournal/Views/Components/AppBackground.swift
T
alexandrev-tibco ff67ea1e71 Fix causa raíz de taps muertos en Charts iPad: AppBackground interceptaba toques (build 50)
El círculo decorativo de AppBackground (70% del ancho del panel, offset -35%)
se desborda de su panel por diseño y en layouts side-by-side queda flotando
SOBRE el sidebar de Charts. Las shapes de SwiftUI participan en hit-testing por
defecto y el panel derecho va después en el HStack → cada tap en la zona del
sidebar cubierta por el círculo moría en silencio. El patrón lo delató: fallaban
Overview + Analyze (arriba, bajo el círculo) y funcionaban Risk + Forecast
(abajo). Dependía de la geometría (orientación/tamaño), por eso no reproducía
en el simulador en portrait.

- AppBackground: .allowsHitTesting(false) — un fondo decorativo jamás debe
  interceptar toques (fix global: aplica también a Sources/Journal en iPad)
- Panel de detalle de Charts: .clipped() para que la decoración tampoco PINTE
  sobre el sidebar
- Selección premium nunca se bloquea: los charts premium se seleccionan y
  muestran teaser de desbloqueo en el área del chart (chart_locked_* ×7 idiomas);
  el paywall se presenta desde el botón (contexto fiable)
- UITests: testChartSidebarSelection ahora corre en landscape (geometría que
  reproducía el bug) + testChartSelectionWithoutPremium nuevo; --no-premium
  en ScreenshotMode para testear la experiencia free

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WoScpmHdVj1aUf4rAp6hbe
2026-07-08 23:30:30 +02:00

38 lines
1.4 KiB
Swift

import SwiftUI
struct AppBackground: View {
var body: some View {
GeometryReader { proxy in
ZStack {
LinearGradient(
colors: [
Color.appPrimary.opacity(0.15),
Color.appSecondary.opacity(0.12),
Color.appAccent.opacity(0.1)
],
startPoint: .topLeading,
endPoint: .bottomTrailing
)
Circle()
.fill(Color.appPrimary.opacity(0.18))
.frame(width: proxy.size.width * 0.7)
.offset(x: -proxy.size.width * 0.35, y: -proxy.size.height * 0.35)
RoundedRectangle(cornerRadius: 120, style: .continuous)
.fill(Color.appAccent.opacity(0.12))
.frame(width: proxy.size.width * 0.8, height: proxy.size.height * 0.35)
.rotationEffect(.degrees(-12))
.offset(x: proxy.size.width * 0.2, y: proxy.size.height * 0.45)
}
.ignoresSafeArea()
}
// Purely decorative must never intercept touches. The circle overflows
// its panel's bounds (offset -35% width), and in side-by-side layouts it
// floats OVER sibling views (e.g. the Charts sidebar on iPad), silently
// swallowing every tap underneath.
.allowsHitTesting(false)
}
}