Add unified page-based details panel on existing layouts

Phase 1 of the player panels redesign:

- New PanelSettings model (pages, regions, layout mode, default
  visibility) stored as an optional field on PlayerControlsLayout with
  an effectivePanelSettings accessor; lenient Codable so future page
  types and settings payloads never corrupt saved presets.
- New Views/Player/Panels content engine: PlayerPanelContentView
  renders a page bar plus the selected page (info, comments, related,
  chapters, queue, tracks), with runtime hiding of empty pages.
- PortraitDetailsPanel and FloatingDetailsPanel now host the shared
  content instead of their duplicated info bodies; drag machinery,
  pills, and fades are untouched.
- Comments list extracted into CommentsListContent shared by the
  overlay and the comments page; comments pill routes to the comments
  page (expanding the portrait panel) when the page is enabled, and
  falls back to the overlay when it is not.
- Tracks page embeds QualitySelectorView via a new isEmbedded mode.
- Deleted the unused video info bodies in ExpandedPlayerSheet+VideoInfo
  and the dead PlayerInfoTab model.
This commit is contained in:
Arkadiusz Fal
2026-09-21 23:20:45 +02:00
parent 8bb6137417
commit d5285b2b83
21 changed files with 1358 additions and 473 deletions

View File

@@ -38,6 +38,9 @@ struct PlayerControlsLayout: Codable, Hashable, Sendable {
/// field still decode.
var wideLayoutPanelAlignment: FloatingPanelSide?
/// Details panel pages configuration. Optional for backward compatibility.
var panelSettings: PanelSettings?
// MARK: - Initialization
@@ -59,7 +62,8 @@ struct PlayerControlsLayout: Codable, Hashable, Sendable {
progressBarSettings: ProgressBarSettings = .default,
gesturesSettings: GesturesSettings? = nil,
playerPillSettings: PlayerPillSettings? = nil,
miniPlayerSettings: MiniPlayerSettings? = nil
miniPlayerSettings: MiniPlayerSettings? = nil,
panelSettings: PanelSettings? = nil
) {
self.topSection = topSection
self.centerSettings = centerSettings
@@ -69,6 +73,7 @@ struct PlayerControlsLayout: Codable, Hashable, Sendable {
self.gesturesSettings = gesturesSettings
self.playerPillSettings = playerPillSettings
self.miniPlayerSettings = miniPlayerSettings
self.panelSettings = panelSettings
}
// MARK: - Gesture Settings
@@ -92,6 +97,13 @@ struct PlayerControlsLayout: Codable, Hashable, Sendable {
miniPlayerSettings ?? .default
}
// MARK: - Panel Settings
/// Returns the effective details panel settings, using defaults if not set.
var effectivePanelSettings: PanelSettings {
panelSettings ?? .default
}
// MARK: - Defaults
/// Default layout matching the current hardcoded player controls.