feat: implement Phase 14 settings & preferences with localStorage persistence

Added comprehensive settings system with 5 categories:
- Recording Settings (existing, integrated)
- Audio Settings (buffer size, sample rate, auto-normalize)
- Editor Settings (auto-save interval, undo limit, snap-to-grid, grid resolution, default zoom)
- Interface Settings (theme, waveform color, font size, default track height)
- Performance Settings (peak/waveform quality, spectrogram toggle, max file size)

Features:
- useSettings hook with localStorage persistence
- Automatic save/load of all settings
- Category-specific reset buttons
- Expanded GlobalSettingsDialog with 5 tabs
- Full integration with AudioEditor
- Settings merge with defaults on load (handles updates gracefully)

Settings are persisted to localStorage and automatically restored on page load.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-19 16:39:05 +01:00
parent 5d9e02fe95
commit adb99a2c33
3 changed files with 653 additions and 91 deletions

View File

@@ -25,6 +25,7 @@ import { ImportTrackDialog } from '@/components/tracks/ImportTrackDialog';
import { formatDuration } from '@/lib/audio/decoder';
import { useHistory } from '@/lib/hooks/useHistory';
import { useRecording } from '@/lib/hooks/useRecording';
import { useSettings } from '@/lib/hooks/useSettings';
import type { EffectType } from '@/lib/audio/effects/chain';
import {
createMultiTrackCutCommand,
@@ -89,6 +90,16 @@ export function AudioEditor() {
setSampleRate,
} = useRecording();
// Settings hook
const {
settings,
updateAudioSettings,
updateUISettings,
updateEditorSettings,
updatePerformanceSettings,
resetCategory,
} = useSettings();
// Multi-track hooks
const {
tracks,
@@ -1710,6 +1721,12 @@ export function AudioEditor() {
onInputGainChange={setInputGain}
onRecordMonoChange={setRecordMono}
onSampleRateChange={setSampleRate}
settings={settings}
onAudioSettingsChange={updateAudioSettings}
onUISettingsChange={updateUISettings}
onEditorSettingsChange={updateEditorSettings}
onPerformanceSettingsChange={updatePerformanceSettings}
onResetCategory={resetCategory}
/>
{/* Export Dialog */}