mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 18:35:05 +00:00
Fix tvOS MPV Options focus and Add/Edit sheet layout
Wrap pushed view in TVSidebarDetailContainer, list custom options first so focus engages on a row, mark default options focusable so the list scrolls. Replace toolbar-based Add/Edit sheets with padded VStacks and inline confirm buttons. Cache customMPVOptions in @Observable backing storage so writes refresh the list immediately.
This commit is contained in:
@@ -16,6 +16,7 @@ extension SettingsManager {
|
||||
/// NOT synced to iCloud - local-only storage.
|
||||
var customMPVOptions: [String: String] {
|
||||
get {
|
||||
if let cached = _customMPVOptions { return cached }
|
||||
guard let data = localDefaults.data(forKey: "customMPVOptions"),
|
||||
let options = try? JSONDecoder().decode([String: String].self, from: data) else {
|
||||
return [:]
|
||||
@@ -23,6 +24,7 @@ extension SettingsManager {
|
||||
return options
|
||||
}
|
||||
set {
|
||||
_customMPVOptions = newValue
|
||||
if let data = try? JSONEncoder().encode(newValue) {
|
||||
localDefaults.set(data, forKey: "customMPVOptions")
|
||||
}
|
||||
|
||||
@@ -117,6 +117,9 @@ final class SettingsManager {
|
||||
// Top Shelf (tvOS)
|
||||
var _topShelfSections: [TopShelfSection]?
|
||||
|
||||
// Custom MPV options (local-only)
|
||||
var _customMPVOptions: [String: String]?
|
||||
|
||||
// Tab bar settings (compact size class only - iOS)
|
||||
var _tabBarItemOrder: [TabBarItem]?
|
||||
var _tabBarItemVisibility: [TabBarItem: Bool]?
|
||||
|
||||
Reference in New Issue
Block a user