mirror of
https://github.com/yattee/yattee.git
synced 2026-10-29 07:57:17 +00:00
Add details panel preset settings UI and default visibility
Phase 2 of the player panels redesign: - New "Details Panel" screen in Player Controls settings: page reorder/enable list with per-page editor (info element toggles), and a default panel visibility picker (hidden/visible/remember). - PlayerControlsSettingsViewModel gains panelSettings bindings with the usual debounced-save flow; the last enabled page cannot be disabled. - Built-in presets bumped to v9 with explicit default panelSettings. - The preset's default visibility now drives the wide-layout panel on player open and on entering landscape, replacing the hard hidden resets; "remember" restores the new detailsPanelLastVisible setting recorded on user toggles. Applied once per expanded player session (flag on NavigationCoordinator survives re-mounts). - WideScreenPlayerLayout picks up external visibility writes so the async-loaded default reaches the mounted layout. - Unit tests for PanelSettings Codable compatibility (round-trip, old JSON, unknown page types/discriminators/enum values); removed stale PlayerInfoTab tests left from Phase 1.
This commit is contained in:
@@ -398,6 +398,24 @@ private struct LayoutSectionsSection: View {
|
||||
)
|
||||
}
|
||||
.disabled(!viewModel.canEditActivePreset)
|
||||
|
||||
// The details panel exists in the iOS and macOS players.
|
||||
#if os(iOS) || os(macOS)
|
||||
NavigationLink {
|
||||
PanelSettingsView(viewModel: viewModel)
|
||||
} label: {
|
||||
HStack {
|
||||
Label(
|
||||
String(localized: "settings.playerControls.detailsPanel"),
|
||||
systemImage: "sidebar.trailing"
|
||||
)
|
||||
Spacer()
|
||||
Text("\(viewModel.enabledPanelPageCount)")
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
.disabled(!viewModel.canEditActivePreset)
|
||||
#endif
|
||||
} header: {
|
||||
Text(String(localized: "settings.playerControls.layoutSections"))
|
||||
} footer: {
|
||||
|
||||
Reference in New Issue
Block a user