From 08c544d1616d6941a04160d0101b8f200945e2e4 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 14 Feb 2026 16:10:45 +0100 Subject: [PATCH] Fix tvOS onboarding background transparency and button styling Add opaque black background to onboarding on tvOS to prevent Home screen content from leaking through the fullScreenCover. Replace toolbar Skip button with plain overlay button to avoid blurred material style, and add tvOS card button style with default focus on Continue button. --- Yattee/Views/Onboarding/OnboardingSheetView.swift | 13 +++++++++++++ .../Views/Onboarding/OnboardingTitleScreen.swift | 15 +++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/Yattee/Views/Onboarding/OnboardingSheetView.swift b/Yattee/Views/Onboarding/OnboardingSheetView.swift index 87463425..ad0d8940 100644 --- a/Yattee/Views/Onboarding/OnboardingSheetView.swift +++ b/Yattee/Views/Onboarding/OnboardingSheetView.swift @@ -63,7 +63,19 @@ struct OnboardingSheetView: View { #elseif os(iOS) .tabViewStyle(.page(indexDisplayMode: .never)) #endif + #if os(tvOS) + .background(Color.black.ignoresSafeArea()) + .overlay(alignment: .topLeading) { + Button(String(localized: "onboarding.skip")) { + completeOnboarding() + } + .buttonStyle(.plain) + .foregroundStyle(.secondary) + .padding(40) + } + #endif .interactiveDismissDisabled() + #if !os(tvOS) .toolbar { ToolbarItem(placement: .cancellationAction) { Button(String(localized: "onboarding.skip")) { @@ -71,6 +83,7 @@ struct OnboardingSheetView: View { } } } + #endif .task { guard !hasCheckedLegacyData else { return } hasCheckedLegacyData = true diff --git a/Yattee/Views/Onboarding/OnboardingTitleScreen.swift b/Yattee/Views/Onboarding/OnboardingTitleScreen.swift index da849b3f..8d1b63fd 100644 --- a/Yattee/Views/Onboarding/OnboardingTitleScreen.swift +++ b/Yattee/Views/Onboarding/OnboardingTitleScreen.swift @@ -10,6 +10,10 @@ import SwiftUI struct OnboardingTitleScreen: View { let onContinue: () -> Void + #if os(tvOS) + @FocusState private var continueButtonFocused: Bool + #endif + var body: some View { GeometryReader { geometry in let iconSize = min(max(geometry.size.height * 0.13, 60), 140) @@ -67,15 +71,26 @@ struct OnboardingTitleScreen: View { .font(.headline) .frame(maxWidth: .infinity) .padding() + #if os(tvOS) + .background(Color.accentColor.opacity(0.2)) + #else .background(Color.accentColor) .foregroundStyle(.white) + #endif .clipShape(RoundedRectangle(cornerRadius: 12)) } + #if os(tvOS) + .buttonStyle(.card) + .focused($continueButtonFocused) + #endif .padding(.horizontal) .padding(.bottom) } .frame(maxWidth: .infinity, maxHeight: .infinity) .padding() + #if os(tvOS) + .onAppear { continueButtonFocused = true } + #endif } } }