From aba26126cce064623d0a27aa7feced33ca27c25f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Wed, 19 Nov 2025 20:55:45 +0100 Subject: [PATCH] refactor: remove configurable track height setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed the defaultTrackHeight setting from UI preferences as it doesn't need to be user-configurable. All tracks now use DEFAULT_TRACK_HEIGHT constant (400px). Changes: - Removed defaultTrackHeight from UISettings interface - Removed track height slider from GlobalSettingsDialog - Updated AudioEditor to use DEFAULT_TRACK_HEIGHT constant directly - Simplified dependency arrays in addTrack callbacks This simplifies the settings interface while maintaining the same visual behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- components/editor/AudioEditor.tsx | 9 ++++---- components/settings/GlobalSettingsDialog.tsx | 23 -------------------- lib/hooks/useSettings.ts | 2 -- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/components/editor/AudioEditor.tsx b/components/editor/AudioEditor.tsx index 729b21b..c53e5b8 100644 --- a/components/editor/AudioEditor.tsx +++ b/components/editor/AudioEditor.tsx @@ -33,6 +33,7 @@ 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 { DEFAULT_TRACK_HEIGHT } from '@/types/track'; import type { EffectType } from '@/lib/audio/effects/chain'; import { createMultiTrackCutCommand, @@ -149,19 +150,19 @@ export function AudioEditor() { // Wrap addTrack to auto-select first track when adding to empty project const addTrack = React.useCallback((name?: string) => { const shouldAutoSelect = shouldAutoSelectRef.current; - const track = addTrackOriginal(name, settings.ui.defaultTrackHeight); + const track = addTrackOriginal(name, DEFAULT_TRACK_HEIGHT); if (shouldAutoSelect) { setSelectedTrackId(track.id); shouldAutoSelectRef.current = false; // Only auto-select once } return track; - }, [addTrackOriginal, settings.ui.defaultTrackHeight]); + }, [addTrackOriginal]); // Wrap addTrackFromBuffer to auto-select first track when adding to empty project const addTrackFromBuffer = React.useCallback((buffer: AudioBuffer, name?: string) => { console.log(`[AudioEditor] addTrackFromBuffer wrapper called: ${name}, shouldAutoSelect: ${shouldAutoSelectRef.current}`); const shouldAutoSelect = shouldAutoSelectRef.current; - const track = addTrackFromBufferOriginal(buffer, name, settings.ui.defaultTrackHeight); + const track = addTrackFromBufferOriginal(buffer, name, DEFAULT_TRACK_HEIGHT); console.log(`[AudioEditor] Track created: ${track.name} (${track.id})`); if (shouldAutoSelect) { console.log(`[AudioEditor] Auto-selecting track: ${track.id}`); @@ -169,7 +170,7 @@ export function AudioEditor() { shouldAutoSelectRef.current = false; // Only auto-select once } return track; - }, [addTrackFromBufferOriginal, settings.ui.defaultTrackHeight]); + }, [addTrackFromBufferOriginal]); // Track which parameters are being touched (for touch/latch modes) const [touchedParameters, setTouchedParameters] = React.useState>(new Set()); diff --git a/components/settings/GlobalSettingsDialog.tsx b/components/settings/GlobalSettingsDialog.tsx index 714a40c..963fbba 100644 --- a/components/settings/GlobalSettingsDialog.tsx +++ b/components/settings/GlobalSettingsDialog.tsx @@ -400,29 +400,6 @@ export function GlobalSettingsDialog({ Adjust the UI font size. Requires reload.

- - {/* Default Track Height */} -
-
- - - {settings.ui.defaultTrackHeight}px - -
- - onUISettingsChange({ defaultTrackHeight: value }) - } - min={120} - max={600} - step={20} - className="w-full" - /> -

- Initial height for new tracks. Default: 400px. -

-
)} diff --git a/lib/hooks/useSettings.ts b/lib/hooks/useSettings.ts index 77c75fc..52534a7 100644 --- a/lib/hooks/useSettings.ts +++ b/lib/hooks/useSettings.ts @@ -11,7 +11,6 @@ export interface AudioSettings { export interface UISettings { theme: 'dark' | 'light' | 'auto'; fontSize: 'small' | 'medium' | 'large'; - defaultTrackHeight: number; // 120-400px } export interface EditorSettings { @@ -45,7 +44,6 @@ const DEFAULT_SETTINGS: Settings = { ui: { theme: 'dark', fontSize: 'medium', - defaultTrackHeight: 400, }, editor: { autoSaveInterval: 3, // 3 seconds