mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 21:22:53 +00:00
Give the empty tvOS Continue Watching screen a focusable Search button
With nothing in progress the screen showed only a ContentUnavailableView, leaving the focus engine nowhere to land and the remote stuck. Search is the target because it always has a focusable field.
This commit is contained in:
@@ -1949,6 +1949,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"continueWatching.empty.search" : {
|
||||
"comment" : "tvOS button on the empty Continue Watching screen that opens Search",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Search Videos"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"continueWatching.remove" : {
|
||||
"comment" : "Remove from continue watching",
|
||||
"localizations" : {
|
||||
|
||||
@@ -219,6 +219,16 @@ struct ContinueWatchingView: View {
|
||||
Label(String(localized: "home.continueWatching.title"), systemImage: "play.circle")
|
||||
} description: {
|
||||
Text(String(localized: "home.continueWatching.empty"))
|
||||
} actions: {
|
||||
#if os(tvOS)
|
||||
// Without a focusable element the focus engine has nowhere to
|
||||
// land, and the remote can no longer reach the sidebar either.
|
||||
Button {
|
||||
appEnvironment?.navigationCoordinator.router.select(.search)
|
||||
} label: {
|
||||
Label(String(localized: "continueWatching.empty.search"), systemImage: "magnifyingglass")
|
||||
}
|
||||
#endif
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user