Offer a delayed Cancel while a tvOS channel loads, and fill the blank state

Without a cached header the channel showed only a spinner, and when the
channel request failed while the videos request succeeded (no cache to
build the channel from) it rendered nothing at all; both left the tvOS
remote with nothing to focus. Cancel stops at the error view and its
Retry, since a sidebar channel is a tab root that cannot be popped; the
blank state now shows the load error with Retry on every platform.
This commit is contained in:
Arkadiusz Fal
2026-10-18 09:04:48 +02:00
parent dd6bbbe691
commit 270e5ffdd3
2 changed files with 23 additions and 0 deletions

View File

@@ -1745,6 +1745,17 @@
}
}
},
"common.loadingStopped" : {
"comment" : "Shown in place of content after the user cancels a slow load on tvOS",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Loading was stopped."
}
}
}
},
"common.loadMore" : {
"localizations" : {
"en" : {

View File

@@ -189,9 +189,21 @@ struct ChannelView: View {
loadingContent(cachedHeader)
} else if isLoading {
ProgressView()
#if os(tvOS)
// As a sidebar channel this is a tab root that cannot
// be popped, so Cancel lands on the error and its Retry.
.tvStalledLoadCancel {
isLoading = false
errorMessage = String(localized: "common.loadingStopped")
}
#endif
.frame(maxWidth: .infinity, maxHeight: .infinity)
} else if let error = errorMessage {
errorView(error)
} else {
// The channel request failed while the videos one did not,
// with no cached header to build the channel from.
errorView(String(localized: "channelView.loadError"))
}
}
}