Duo deck: Now Playing tab, full-pane Stems / Lyrics / Playing Next / EQ pages

Unfolded with something playing, the tab bar leads with a Now Playing item that shows the
deck beside docked Now Playing. Each deck page gets the whole pane; the queue moved to its
own page and a vertical graphic EQ page was added. Dev build 27.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-11-18 15:00:00 -08:00
1 parent 190b793043
commit 4ddcfd7ff5
5 files changed
+166 -49

No files matched your search

+39 -29
View File
@@ -248,9 +248,9 @@ struct NowPlayingScreen: View {
.padding(.top, tight ? 4 : 14)
HStack {
let hidden = NowPlayingButton.hidden(g.settings.hiddenNowPlaying)
if !hidden.contains(.Mixer) { PanelToggle(symbol: "slider.vertical.3", on: docked ? ui.deck && !ui.deckLyrics : panel == .Mixer) { show(.Mixer) } }
if !hidden.contains(.Mixer) { PanelToggle(symbol: "slider.vertical.3", on: docked ? ui.showsDeck && ui.deckPage == .Stems : panel == .Mixer) { show(.Mixer) } }
if !hidden.contains(.Speed) { SpeedMenu() }
if !hidden.contains(.Route) { Button { ui.showInSettings(.Eq) } label: { routeLabel(c) }.buttonStyle(PressFade()).frame(maxWidth: .infinity) } else { Spacer() }
if !hidden.contains(.Route) { Button { if docked { withAnimation(.snappy) { ui.showDeck(.Eq) } } else { ui.showInSettings(.Eq) } } label: { routeLabel(c) }.buttonStyle(PressFade()).frame(maxWidth: .infinity) } else { Spacer() }
if !hidden.contains(.AirPlay) { AirPlayButton(tint: UIColor(c.label2), active: UIColor(c.accent)).frame(width: 40, height: 40) }
if !hidden.contains(.Karaoke) { PanelToggle(symbol: "music.mic", on: pm.karaoke) { karaoke() } }
}
@@ -276,9 +276,9 @@ struct NowPlayingScreen: View {
// Docked, the lyrics get the deck's whole side of the hinge.
if docked {
withAnimation(.snappy(duration: 0.25)) {
if pm.karaoke && !(ui.deck && ui.deckLyrics) { ui.showDeck(lyrics: true); return }
if pm.karaoke && !(ui.showsDeck && ui.deckPage == .Lyrics) { ui.showDeck(.Lyrics); return }
pm.setKaraoke(!pm.karaoke)
ui.showDeck(lyrics: pm.karaoke)
ui.showDeck(pm.karaoke ? .Lyrics : .Stems)
}
return
}
@@ -292,7 +292,7 @@ struct NowPlayingScreen: View {
private func show(_ to: NpPanel) {
// Docked, the stems and the queue have the other side of the hinge to themselves.
// The queue lives only in the deck there, never a second copy beside it.
if docked { if to == .Mixer { withAnimation(.snappy) { ui.showDeck() } }; return }
if docked { if to == .Mixer { withAnimation(.snappy) { ui.showDeck(.Stems) } }; return }
withAnimation(.spring(duration: 0.38, bounce: 0.12)) { panel = panel == to ? .Art : to }
}
@@ -1005,8 +1005,8 @@ struct FaderSlider: View {
// ---- deck -----------------------------------------------------------------------------------
/// Unfolded iPhone Duo: the stems over the queue, or the lyrics, on the other side of the hinge
/// from Now Playing. The stems stay put and the queue scrolls in what's left under them.
/// Unfolded iPhone Duo: the Now Playing tab's side of the hinge, across from docked Now Playing.
/// One page at a time (stems, lyrics, the queue or the EQ), each with the whole pane to itself.
struct NowPlayingDeck: View {
@Environment(Ui.self) private var ui
@Environment(\.palette) private var base
@@ -1017,21 +1017,20 @@ struct NowPlayingDeck: View {
var body: some View {
let c = tint.map { base.tinted($0) } ?? base
let track = g.playback.current?.track
GeometryReader { geo in
GeometryReader { _ in
if let track {
VStack(spacing: 0) {
header(c)
if ui.deckLyrics {
LyricsPanel(track: track).frame(maxHeight: .infinity)
} else {
let n = max(g.playback.stemNames.count, 1)
// Every stem without scrolling comes first; the queue scrolls in whatever is left.
let fit = MixerPanel.roomyChrome + CGFloat(n) * MixerPanel.roomyMin + 8
let mixH = min(max(fit, min(MixerPanel.roomyHeight(n), geo.size.height - 260)), geo.size.height - 36)
MixerPanel(roomy: true).frame(height: max(mixH, 0))
Rectangle().fill(c.label3.opacity(0.35)).frame(height: 0.5).padding(.horizontal, 24).padding(.bottom, 4)
QueuePanel().frame(maxHeight: .infinity)
Group {
switch ui.deckPage {
case .Stems: MixerPanel(roomy: true)
case .Lyrics: LyricsPanel(track: track)
case .Queue: QueuePanel(title: false)
case .Eq: DeckEqPanel()
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
.transition(.opacity)
}
} else {
Text("Nothing Playing").font(.title3.weight(.semibold)).foregroundStyle(c.label2)
@@ -1045,18 +1044,21 @@ struct NowPlayingDeck: View {
.modifier(NpScheme(dark: c.dark, docked: true))
.tint(c.label)
.animation(.easeInOut(duration: 0.3), value: tint)
.animation(.snappy(duration: 0.25), value: ui.deckLyrics)
.animation(.snappy(duration: 0.25), value: ui.deckPage)
.task(id: "\(track?.thumb ?? "")|\(g.settings.albumColorNowPlaying)|\(base.dark)") {
guard g.settings.albumColorNowPlaying, let thumb = track?.thumb else { tint = nil; return }
tint = await albumColor(thumb, dark: base.dark)
}
}
/// Stems or Lyrics, and the button that moves Now Playing to the other side of the hinge.
/// The page names, and the button that moves Now Playing to the other side of the hinge.
private func header(_ c: Palette) -> some View {
HStack(spacing: 18) {
page("Stems", on: !ui.deckLyrics, c) { ui.showDeck(lyrics: false) }
page("Lyrics", on: ui.deckLyrics, c) { ui.showDeck(lyrics: true) }
ViewThatFits(in: .horizontal) {
pages(c, spacing: 22)
pages(c, spacing: 14)
ScrollView(.horizontal) { pages(c, spacing: 18) }.scrollIndicators(.hidden)
}
Spacer(minLength: 0)
Button { withAnimation(.spring(duration: 0.4, bounce: 0.1)) { swap.toggle() } } label: {
Image(systemName: "arrow.left.arrow.right").font(.body.weight(.semibold)).foregroundStyle(c.label2)
@@ -1068,12 +1070,18 @@ struct NowPlayingDeck: View {
.padding(.horizontal, 24).frame(height: 36)
}
private func page(_ title: String, on: Bool, _ c: Palette, _ action: @escaping () -> Void) -> some View {
Button(action: action) {
Text(title).font(.headline).foregroundStyle(on ? c.label : c.label3)
private func pages(_ c: Palette, spacing: CGFloat) -> some View {
HStack(spacing: spacing) {
ForEach(DeckPage.allCases, id: \.self) { pg in
let on = ui.deckPage == pg
Button { withAnimation(.snappy(duration: 0.25)) { ui.showDeck(pg) } } label: {
Text(pg.title).font(.headline).foregroundStyle(on ? c.label : c.label3)
.lineLimit(1).fixedSize().frame(minHeight: 36).contentShape(Rectangle())
}
.buttonStyle(.plain)
.accessibilityAddTraits(on ? .isSelected : [])
}
}
.buttonStyle(.plain)
.accessibilityAddTraits(on ? .isSelected : [])
}
}
@@ -1081,6 +1089,8 @@ struct NowPlayingDeck: View {
private struct QueuePanel: View {
var close: () -> Void = {}
/// The deck's header already says "Playing Next", so there it shows just the count.
var title = true
@Environment(\.palette) private var p
private var g: AppGraph { .shared }
@@ -1091,8 +1101,8 @@ private struct QueuePanel: View {
VStack(spacing: 0) {
HStack(spacing: 8) {
VStack(alignment: .leading, spacing: 1) {
Text("Playing Next").font(.headline).foregroundStyle(p.label)
Text(songs(upcoming.count)).font(.footnote).foregroundStyle(p.label2)
if title { Text("Playing Next").font(.headline).foregroundStyle(p.label) }
Text(songs(upcoming.count)).font(title ? .footnote : .subheadline).foregroundStyle(p.label2)
}
Spacer()
QueueToggle(symbol: "shuffle", on: pm.shuffle, action: pm.toggleShuffle)