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

+30 -8
View File
@@ -36,6 +36,19 @@ enum Tab: String, CaseIterable, Hashable {
}
}
/// The pages of the deck beside docked Now Playing on an unfolded iPhone Duo.
enum DeckPage: String, CaseIterable, Hashable {
case Stems, Lyrics, Queue, Eq
var title: String {
switch self {
case .Stems: "Stems"
case .Lyrics: "Lyrics"
case .Queue: "Playing Next"
case .Eq: "EQ"
}
}
}
enum Route: Hashable {
case Artists, Albums, Songs, RecentlyAdded, Playlists, Genres, Downloads, DownloadQueue, TabBar, WebRadio
case Eq, EqFilters(profileId: String), EqFilterPage(profileId: String, filterId: String)
@@ -54,10 +67,10 @@ final class Ui {
}
/// True while an unfolded iPhone Duo shows Now Playing docked beside the library.
private(set) var split = false
/// Split only: the side opposite Now Playing shows the stems and queue (true) or the selected tab.
/// Split only: the Now Playing tab (the deck) is selected instead of `tab`.
var deck = true
/// Split only: the deck shows the lyrics (karaoke) instead of the stems and queue.
var deckLyrics = false
/// Split only: which of the deck's pages is showing.
var deckPage: DeckPage = .Stems
let overlays: Overlays
init(overlays: Overlays) { self.overlays = overlays }
@@ -72,12 +85,21 @@ final class Ui {
/// Tapping the selected tab again pops it to its root.
func selectTab(_ t: Tab) {
if split && deck { deck = false; tab = t; return }
if showsDeck { deck = false; tab = t; return }
if t == tab { paths[t] = [] } else { tab = t }
}
/// The tabs currently in the bar, in order.
var tabs: [Tab] { Tab.layout(AppGraph.shared.settings.tabLayout) }
/// Split with something playing, the bar leads with a Now Playing item that opens the deck.
var hasDeckTab: Bool { split && AppGraph.shared.playback.current != nil }
var showsDeck: Bool { hasDeckTab && deck }
/// The tabs currently in the bar, in order. The Now Playing item takes one of the five places
/// (iOS folds a sixth into "More"), so the last one before Settings steps aside for it.
var tabs: [Tab] {
var t = Tab.layout(AppGraph.shared.settings.tabLayout)
if hasDeckTab && t.count >= Tab.maxVisible, let i = t.lastIndex(where: { $0 != .Settings }) { t.remove(at: i) }
return t
}
/// Where library pages open: Library if it's in the bar, else the first tab that is.
private var home: Tab { tabs.contains(.Library) ? .Library : (tabs.first ?? .Settings) }
@@ -96,7 +118,7 @@ final class Ui {
func openNowPlaying() { if !split { nowPlayingOpen = true } }
/// Split only: brings the stems and queue (or the lyrics) back beside Now Playing.
func showDeck(lyrics: Bool = false) { deck = true; deckLyrics = lyrics }
func showDeck(_ page: DeckPage? = nil) { deck = true; if let page { deckPage = page } }
func setSplit(_ on: Bool) {
guard on != split else { return }
@@ -107,7 +129,7 @@ final class Ui {
UserDefaults.standard.set(true, forKey: "duoSeen")
}
// Karaoke left on shows its lyrics in the deck.
deckLyrics = on && AppGraph.shared.playback.karaoke
if on && AppGraph.shared.playback.karaoke { deckPage = .Lyrics } else if deckPage == .Lyrics { deckPage = .Stems }
}
/// Switches to the Library tab and pushes [r] there.