Playlist pages: header rides up into the empty nav bar, bar title hidden (build 64)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
42f5eddb36
commit
b10528d69c
3 files changed
+14
-6
No files matched your search
@@ -143,7 +143,7 @@ struct StemPlaylistScreen: View {
|
||||
.navigationTitle(pl.title)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
} else {
|
||||
Page(title: pl.title, large: false) {
|
||||
Page(title: pl.title, large: false, pullUp: BAR_PULL) {
|
||||
header(pl)
|
||||
if pl.items.isEmpty {
|
||||
EmptyState(icon: "slider.horizontal.3", title: "No Songs",
|
||||
@@ -164,7 +164,7 @@ struct StemPlaylistScreen: View {
|
||||
else { MoreMenu(items: moreItems(pl)) }
|
||||
}
|
||||
}
|
||||
.modifier(SplitHidesTitle())
|
||||
.modifier(SplitHidesTitle(bare: !editing))
|
||||
}
|
||||
|
||||
private func header(_ pl: StemPlaylist) -> some View {
|
||||
@@ -279,7 +279,7 @@ struct PlaylistScreen: View {
|
||||
.navigationTitle(title)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
} else {
|
||||
Page(title: title, large: false) {
|
||||
Page(title: title, large: false, pullUp: BAR_PULL) {
|
||||
header(list)
|
||||
Loaded(state: tracks, retry: { reload += 1 }) { list in
|
||||
ForEach(Array(list.enumerated()), id: \.element.id) { i, t in
|
||||
@@ -297,7 +297,7 @@ struct PlaylistScreen: View {
|
||||
else { MoreMenu(items: moreItems(list)) }
|
||||
}
|
||||
}
|
||||
.modifier(SplitHidesTitle())
|
||||
.modifier(SplitHidesTitle(bare: !editing))
|
||||
.task(id: reload) {
|
||||
await LoadState.load($tracks) { try await g.plex.playlistTracks(playlist.ratingKey) }
|
||||
}
|
||||
@@ -426,11 +426,16 @@ struct SearchScreen: View {
|
||||
}
|
||||
|
||||
/// Split at the Duo's hinge the pane's own header already names the playlist, so the bar drops the title.
|
||||
/// How far a playlist page's header rides up into the empty nav bar, between back and •••.
|
||||
private let BAR_PULL: CGFloat = 40
|
||||
|
||||
/// Hides the bar title in split view, and while [bare] (the header already shows it).
|
||||
private struct SplitHidesTitle: ViewModifier {
|
||||
var bare = false
|
||||
@Environment(Ui.self) private var ui
|
||||
func body(content: Content) -> some View {
|
||||
content.toolbar {
|
||||
if ui.split { ToolbarItem(placement: .principal) { Color.clear.frame(width: 1, height: 1) } }
|
||||
if ui.split || bare { ToolbarItem(placement: .principal) { Color.clear.frame(width: 1, height: 1) } }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user