Give the empty tvOS Accounts screen a focusable Open Sources button

With no accounts the screen showed only a ContentUnavailableView, so the
focus engine had nothing to land on and the remote could not reach the
sidebar again; the app had to be force-quit. Sources is also where an
account is signed in.
This commit is contained in:
Arkadiusz Fal
2026-10-15 23:51:07 +02:00
parent afa490240a
commit 164f828098
2 changed files with 22 additions and 0 deletions

View File

@@ -256,6 +256,17 @@
}
}
},
"accounts.empty.openSources" : {
"comment" : "tvOS button on the empty Accounts screen that opens the Sources list",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Open Sources"
}
}
}
},
"accounts.empty.title" : {
"localizations" : {
"en" : {

View File

@@ -158,6 +158,17 @@ struct AccountsListView: View {
Label(String(localized: "accounts.empty.title"), systemImage: "person.crop.circle")
} description: {
Text(String(localized: "accounts.empty.description"))
} 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.
// Sources is also where an account is actually signed in.
NavigationLink {
SourcesListView()
} label: {
Label(String(localized: "accounts.empty.openSources"), systemImage: "server.rack")
}
#endif
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
}