From d5dfcf5b7ce4db5bc6fd8f565d3fd3089f773d9b Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 6 Oct 2026 14:34:28 -0400 Subject: [PATCH] fix: boost control is a switch; MutationQueue keeps one enqueue per kind (M464 #4998) The ListenBrainz settings test finds the page's one checkbox, and the boost control is a toggle anyway. detekt counts MutationQueue's enqueue functions; suppressed as the replayer's dispatchers already are. Co-Authored-By: Claude Opus 5.5 --- .../com/fabledsword/minstrel/cache/mutations/MutationQueue.kt | 1 + web/src/lib/components/NormalizationSetting.svelte | 2 ++ web/src/lib/components/NormalizationSetting.test.ts | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/java/com/fabledsword/minstrel/cache/mutations/MutationQueue.kt b/android/app/src/main/java/com/fabledsword/minstrel/cache/mutations/MutationQueue.kt index be70247a..32ea636c 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/cache/mutations/MutationQueue.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/cache/mutations/MutationQueue.kt @@ -91,6 +91,7 @@ data class RequestCreatePayload( * This matches `feedback_offline_first_for_server_writes` — writes * never go fire-and-forget. */ +@Suppress("TooManyFunctions") // one enqueue per mutation kind, like the replayer's dispatchers @Singleton class MutationQueue @Inject constructor( private val dao: CachedMutationDao, diff --git a/web/src/lib/components/NormalizationSetting.svelte b/web/src/lib/components/NormalizationSetting.svelte index d147d29c..e6bb8ab5 100644 --- a/web/src/lib/components/NormalizationSetting.svelte +++ b/web/src/lib/components/NormalizationSetting.svelte @@ -94,6 +94,8 @@ change({ boost: (e.currentTarget as HTMLInputElement).checked ? 'limiter' : 'headroom' })} diff --git a/web/src/lib/components/NormalizationSetting.test.ts b/web/src/lib/components/NormalizationSetting.test.ts index ef5317c9..eb671d6b 100644 --- a/web/src/lib/components/NormalizationSetting.test.ts +++ b/web/src/lib/components/NormalizationSetting.test.ts @@ -31,7 +31,7 @@ describe('NormalizationSetting', () => { await waitFor(() => expect(putNormalization).toHaveBeenCalledWith({ mode: 'album', target_lufs: -16, boost: 'headroom' }) ); - await fireEvent.click(screen.getByRole('checkbox', { name: /boost quiet tracks/i })); + await fireEvent.click(screen.getByRole('switch', { name: /boost quiet tracks/i })); await waitFor(() => expect(putNormalization).toHaveBeenLastCalledWith({ mode: 'album', target_lufs: -16, boost: 'limiter' }) ); @@ -60,6 +60,6 @@ describe('NormalizationSetting', () => { render(NormalizationSetting); await waitFor(() => expect(screen.getByRole('radio', { name: 'Off' })).toBeChecked()); expect(screen.queryByRole('radio', { name: '-18 LUFS' })).toBeNull(); - expect(screen.queryByRole('checkbox')).toBeNull(); + expect(screen.queryByRole('switch')).toBeNull(); }); });