Fix Add to Playlist sheet layout on macOS

The sheet collapsed to an empty strip because a List inside a sheet
has no intrinsic height on macOS. Add an explicit minimum frame like
other sheets, gate presentationDetents to iOS, and replace the
prominent xmark toolbar button with a native Close button on macOS.
This commit is contained in:
Arkadiusz Fal
2026-05-20 09:15:27 +02:00
parent 6dfa63c263
commit 7cb068c800

View File

@@ -89,6 +89,13 @@ struct PlaylistSelectorSheet: View {
.navigationBarTitleDisplayMode(.inline)
#endif
.toolbar {
#if os(macOS)
ToolbarItem(placement: .cancellationAction) {
Button(String(localized: "common.close"), role: .cancel) {
dismiss()
}
}
#else
ToolbarItem(placement: .confirmationAction) {
Button(role: .cancel) {
dismiss()
@@ -97,6 +104,7 @@ struct PlaylistSelectorSheet: View {
.labelStyle(.iconOnly)
}
}
#endif
}
#endif
.sheet(isPresented: $showingNewPlaylist) {
@@ -114,7 +122,12 @@ struct PlaylistSelectorSheet: View {
loadPlaylists()
}
}
#if os(iOS)
.presentationDetents([.medium, .large])
#endif
#if os(macOS)
.frame(minWidth: 450, minHeight: 500)
#endif
}
private func loadPlaylists() {