Present instance login as full-screen cover on tvOS

The .sheet rendering on tvOS produced a tiny floating modal where the
"Sign In" title wrapped onto two lines and form fields overflowed. Use
.fullScreenCover on tvOS and wrap the login form in
TVSidebarDetailContainer so the title/icon sit in the standard 400pt
left sidebar. iOS and macOS keep the existing sheet presentation.
This commit is contained in:
Arkadiusz Fal
2026-05-06 21:44:55 +02:00
parent 411fcba037
commit 38242edf0c
2 changed files with 18 additions and 22 deletions

View File

@@ -353,12 +353,21 @@ private struct EditRemoteServerContent: View {
Button(String(localized: "common.cancel"), role: .cancel) {}
}
.presentationCompactAdaptation(.sheet)
#if os(tvOS)
.fullScreenCover(isPresented: $showLoginSheet) {
InstanceLoginView(instance: instance) { credential in
appEnvironment?.credentialsManager(for: instance)?.setCredential(credential, for: instance)
isLoggedIn = true
}
}
#else
.sheet(isPresented: $showLoginSheet) {
InstanceLoginView(instance: instance) { credential in
appEnvironment?.credentialsManager(for: instance)?.setCredential(credential, for: instance)
isLoggedIn = true
}
}
#endif
.onAppear {
isLoggedIn = appEnvironment?.credentialsManager(for: instance)?.isLoggedIn(for: instance) ?? false