Simplify the wide-layout details panel: floating-only on iPhone, side as a preset setting

iPhone landscape now uses the floating panel only, always on the right;
the pin and side-toggle buttons on the grabber are gone and the pinned
setting resolves to false on phone.

iPad and macOS default to the pinned side-by-side layout, keep the pin
button to switch to floating, and pick the panel side in the preset's
panel settings instead of an on-screen arrow. The pinned state persists
as a layout preference: closing the player or the hidden default
visibility no longer resets it.

Removes PanelAlignmentButton, the global floatingDetailsPanelSide setting
and its key, FloatingPanelSide.opposite, and the legacy
wideLayoutPanelAlignment preset field.
This commit is contained in:
Arkadiusz Fal
2026-09-26 22:48:11 +02:00
parent c33d66ca1f
commit 4210b0ab05
15 changed files with 122 additions and 137 deletions

View File

@@ -359,16 +359,22 @@ struct PanelSettings: Codable, Hashable, Sendable {
/// Whether the page bar shows labels next to icons.
var showPageBarLabels: Bool?
/// Which side the details panel sits on in the standard wide layout on
/// iPad/macOS. iPhone ignores it (always right). Effective default: `.right`.
var wideLayoutSide: FloatingPanelSide?
init(
pages: [PanelPageConfiguration],
layoutMode: PanelLayoutMode? = nil,
defaultVisibility: PanelDefaultVisibility? = nil,
showPageBarLabels: Bool? = nil
showPageBarLabels: Bool? = nil,
wideLayoutSide: FloatingPanelSide? = nil
) {
self.pages = pages
self.layoutMode = layoutMode
self.defaultVisibility = defaultVisibility
self.showPageBarLabels = showPageBarLabels
self.wideLayoutSide = wideLayoutSide
}
/// In-memory cache of the active preset's panel settings, refreshed by the
@@ -388,6 +394,7 @@ struct PanelSettings: Codable, Hashable, Sendable {
var effectiveLayoutMode: PanelLayoutMode { layoutMode ?? .stacked }
var effectiveDefaultVisibility: PanelDefaultVisibility { defaultVisibility ?? .hidden }
var effectiveShowPageBarLabels: Bool { showPageBarLabels ?? true }
var effectiveWideLayoutSide: FloatingPanelSide { wideLayoutSide ?? .right }
/// Pages the panel should offer, in order. Pass a region to filter for
/// corner mode; `nil` returns enabled pages from all regions.
@@ -488,6 +495,7 @@ struct PanelSettings: Codable, Hashable, Sendable {
case layoutMode
case defaultVisibility
case showPageBarLabels
case wideLayoutSide
}
init(from decoder: Decoder) throws {
@@ -509,6 +517,7 @@ struct PanelSettings: Codable, Hashable, Sendable {
layoutMode = try? container.decodeIfPresent(PanelLayoutMode.self, forKey: .layoutMode)
defaultVisibility = try? container.decodeIfPresent(PanelDefaultVisibility.self, forKey: .defaultVisibility)
showPageBarLabels = try container.decodeIfPresent(Bool.self, forKey: .showPageBarLabels)
wideLayoutSide = try? container.decodeIfPresent(FloatingPanelSide.self, forKey: .wideLayoutSide)
}
func encode(to encoder: Encoder) throws {
@@ -517,6 +526,7 @@ struct PanelSettings: Codable, Hashable, Sendable {
try container.encodeIfPresent(layoutMode, forKey: .layoutMode)
try container.encodeIfPresent(defaultVisibility, forKey: .defaultVisibility)
try container.encodeIfPresent(showPageBarLabels, forKey: .showPageBarLabels)
try container.encodeIfPresent(wideLayoutSide, forKey: .wideLayoutSide)
}
}

View File

@@ -33,11 +33,6 @@ struct PlayerControlsLayout: Codable, Hashable, Sendable {
/// Mini player settings. Optional for backward compatibility.
var miniPlayerSettings: MiniPlayerSettings?
/// Unused: the player reads the panel side from SettingsManager
/// (`floatingDetailsPanelSide`). Kept only so old presets that saved this
/// field still decode.
var wideLayoutPanelAlignment: FloatingPanelSide?
/// Details panel pages configuration. Optional for backward compatibility.
var panelSettings: PanelSettings?