From 4916c4a36fa70ecab5ec86eb2cde02fcfe3ce8b5 Mon Sep 17 00:00:00 2001 From: Frank Stellmacher <171614930+Psychotoxical@users.noreply.github.com> Date: Sun, 17 May 2026 13:11:01 +0200 Subject: [PATCH] fix(equalizer): redraw curve when
reopens (#747) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(equalizer): redraw curve when surrounding
toggles open ResizeObserver does not reliably fire for the `display:none → block` transition that the SettingsSubSection `
` causes when the user expands the Equalizer panel after collapsing it. drawCurve bails on a zero-sized canvas (existing macOS-WebKit guard), and without a new trigger the second open leaves the frequency-response canvas blank. Add a `toggle` listener on the closest `
` ancestor; on open, redraw after one rAF so the canvas has its laid-out size. Additive — doesn't change the working ResizeObserver path. * docs(changelog): note Equalizer canvas redraw fix (#747) --- CHANGELOG.md | 6 ++++++ src/components/Equalizer.tsx | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9253d5ad..59de17c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -645,6 +645,12 @@ Foundational work: faster reviews, narrower diffs, and a safety net under the pa * Clicking the **artist** in the Favorites songs table opened the artist page _and_ started the song — the cell was missing the click guard the album cell already had. Now matches every other tracklist in the app. * Selecting a song no longer pushes the column header and every row down by one line. The "X selected / Add to playlist / Clear" cluster moved out of the full-width bar into the existing action-buttons row (right-aligned), matching the album toolbar, so the next item stays under the same cursor position. +### Equalizer — frequency-response curve no longer disappears on re-expand + +**By [@Psychotoxical](https://github.com/Psychotoxical), thanks to zunoz for the report on the Psysonic Discord, PR [#747](https://github.com/Psychotoxical/psysonic/pull/747)** + +* Collapsing and re-expanding **Settings → Audio → Equalizer** sometimes left the curve area blank: `ResizeObserver` does not reliably fire for the `display: none → block` transition the surrounding `
` triggers, so the redraw that depends on it never ran on the second open. A `toggle` listener on the parent `
` now redraws explicitly on open. + ## [1.45.0] - 2026-05-04 ## Added diff --git a/src/components/Equalizer.tsx b/src/components/Equalizer.tsx index c9edb713..8a20dd32 100644 --- a/src/components/Equalizer.tsx +++ b/src/components/Equalizer.tsx @@ -41,6 +41,20 @@ export default function Equalizer() { return () => ro.disconnect(); }, [redraw]); + // ResizeObserver does not always fire for the `display: none → block` + // transition the surrounding
causes when toggled, leaving the + // canvas blank on the second open. Redraw explicitly when the parent + //
opens; rAF waits one frame for the canvas to take its size. + useEffect(() => { + const details = canvasRef.current?.closest('details'); + if (!details) return; + const onToggle = () => { + if (details.open) requestAnimationFrame(redraw); + }; + details.addEventListener('toggle', onToggle); + return () => details.removeEventListener('toggle', onToggle); + }, [redraw]); + const isCustomSaved = activePreset && !BUILTIN_PRESETS.some(p => p.name === activePreset); const selectValue = activePreset ?? '__custom__';