From 7568a3b9d3448c421251710567592f16cdd56f76 Mon Sep 17 00:00:00 2001 From: Trey t Date: Sun, 12 Apr 2026 17:05:17 -0500 Subject: [PATCH] Fix tvOS focus navigation: add focusSection to all major UI sections Focus couldn't move from DashboardView controls up to the CategoryPillBar, or between sections within screens. Added .platformFocusSection() to: - ContentView: pill bar and content area as separate focus sections - DashboardView: header, overview strip, hero+control section - LeagueCenterView: schedule, standings, leaders, teams sections This lets the tvOS Focus Engine navigate vertically between all sections with d-pad up/down. Co-Authored-By: Claude Opus 4.6 (1M context) --- mlbTVOS/Views/ContentView.swift | 2 ++ mlbTVOS/Views/DashboardView.swift | 3 +++ mlbTVOS/Views/LeagueCenterView.swift | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mlbTVOS/Views/ContentView.swift b/mlbTVOS/Views/ContentView.swift index 88dbbef..468b158 100644 --- a/mlbTVOS/Views/ContentView.swift +++ b/mlbTVOS/Views/ContentView.swift @@ -22,6 +22,7 @@ struct ContentView: View { ) .padding(.horizontal, DS.Spacing.edgeInset) .padding(.top, navPadTop) + .platformFocusSection() if showsTicker { ScoresTickerView() @@ -43,6 +44,7 @@ struct ContentView: View { } } .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top) + .platformFocusSection() } } .task { diff --git a/mlbTVOS/Views/DashboardView.swift b/mlbTVOS/Views/DashboardView.swift index 7bd2e3d..b8a27c5 100644 --- a/mlbTVOS/Views/DashboardView.swift +++ b/mlbTVOS/Views/DashboardView.swift @@ -120,6 +120,7 @@ struct DashboardView: View { ScrollView { VStack(alignment: .leading, spacing: contentSpacing) { headerSection + .platformFocusSection() if viewModel.isLoading { loadingState @@ -127,7 +128,9 @@ struct DashboardView: View { errorState(error) } else { overviewStrip + .platformFocusSection() heroAndControlSection + .platformFocusSection() if !viewModel.liveGames.isEmpty { gameShelf( diff --git a/mlbTVOS/Views/LeagueCenterView.swift b/mlbTVOS/Views/LeagueCenterView.swift index 0794273..c0fb813 100644 --- a/mlbTVOS/Views/LeagueCenterView.swift +++ b/mlbTVOS/Views/LeagueCenterView.swift @@ -35,16 +35,18 @@ struct LeagueCenterView: View { } scheduleSection + .platformFocusSection() #if os(tvOS) - // Side-by-side: standings left, leaders right HStack(alignment: .top, spacing: 24) { standingsSection .frame(maxWidth: .infinity) + .platformFocusSection() if !viewModel.leagueLeaders.isEmpty { leadersColumnSection .frame(width: 420) + .platformFocusSection() } } #else @@ -56,6 +58,7 @@ struct LeagueCenterView: View { #endif teamsSection + .platformFocusSection() if let selectedTeam = viewModel.selectedTeam { teamProfileSection(team: selectedTeam)