persist trim across sessions

This commit is contained in:
Boof2015
2026-04-08 23:06:21 -04:00
parent 27f4b9610a
commit 3ebd6619dc
4 changed files with 226 additions and 4 deletions
+28
View File
@@ -27,6 +27,7 @@ import {
} from '../src/shared/windowGeometry'
import { calculateResizedWindowBounds } from '../src/shared/windowResize'
import { createDefaultTheme, resolveNativeThemeSource, resolveTheme } from '../src/shared/themeState'
import { useAudioStore } from '../src/renderer/stores/audioStore'
import { usePerformanceStore } from '../src/renderer/stores/performanceStore'
import { buildProfileDraft, profilesMatch } from '../src/renderer/stores/profileDraft'
import {
@@ -1577,6 +1578,33 @@ test('applying a profile snapshot does not change the machine-local frame target
}
})
test('applying a profile snapshot does not change the machine-local trim', () => {
const previousAudioState = useAudioStore.getState()
const previousSettingsState = useSettingsStore.getState()
try {
useAudioStore.setState({ inputGainDb: 6.5 })
const defaultProfile = createDefaultProfile('Default')
const alternateProfile = createDefaultProfile('Live Mix')
alternateProfile.hiddenScopes = []
alternateProfile.scopeSettings.waveform.gainDb = 6
useSettingsStore.getState().applyExternalProfileSnapshot({
activeProfileId: 'profile_live_mix',
profiles: {
profile_default: defaultProfile,
profile_live_mix: alternateProfile,
},
})
assert.equal(useAudioStore.getState().inputGainDb, 6.5)
} finally {
useAudioStore.setState(previousAudioState)
useSettingsStore.setState(previousSettingsState)
}
})
test('profile draft comparisons return to clean after reverting a change', () => {
const baselineProfile = createDefaultProfile(DEFAULT_PROFILE_NAME)
baselineProfile.windowBounds = { x: 24, y: 48, width: 900, height: 180 }