settings inside Visualizer not saving #4
Owner
```
1. State Persistence & Lifecycle
• Fix Depth Offset Persistence: The depthOffset variable is currently volatile. Ensure it is wrapped in @AppStorage or integrated into the persistent UserDefaults suite so the value is written to disk and restored upon app launch.
• Visualizer Idling Logic: Implement a centralized "idling" state. When audio playback is paused or the buffer is empty, the CADisplayLink or rendering loop for both the Now Playing and Mini Player subviews must be invalidated or halted to conserve CPU and battery.
2. Architectural Refactoring: Independent Settings
The goal is to decouple the visualizer configurations so that the Now Playing view and Mini Player view operate with unique, independent state objects.
Settings Migration
Move the following properties into separate sub-configurations for each view type:
• Style: (e.g., Bar, Wave, Line).
• Color: Independent selection for each view.
• Presets: Saved configurations specific to the context (Now Playing vs. Mini Player).
Independent State Logic
Ensure that changing a specific parameter within one style does not bleed into another.
• Example: If the Bar style has pointCount set to 30, switching to Wave should use its own waveSensitivity or tension values without being influenced by the previous pointCount data. Use a structured VisualizerConfiguration model that holds unique properties for each Style enum case.
3. UI Component Migration
• Deprecate Liquid Glass: Remove all custom "Liquid Glass" or highly experimental glassmorphic UI components. These are causing rendering issues and performance bottlenecks.
• Standardization: Replace these elements with native SwiftUI Button and Slider components.
• Use standard materials (e.g., .ultraThinMaterial) for the background if a blurred look is still desired, but rely on the system's robust layout engine for the controls themselves to ensure stability across macOS and iOS.
Agent Action Checklist
1. [ ] Audit VisualizerSettings.swift: Identify depthOffset and apply @AppStorage.
2. [ ] Update VisualizerView: Add logic to stop rendering when isPlaying is false.
3. [ ] Refactor Configuration Model: Create a nested structure: Settings > {NowPlaying, MiniPlayer} > {Style, Color, Presets}.
4. [ ] UI Swap: Search and replace all instances of LiquidGlassButton and LiquidGlassSlider with standard SwiftUI equivalents.
```
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?