fix(audio-mixer): make volume faders drag with the pointer#859
Open
LegionaryLeader wants to merge 2 commits into
Open
fix(audio-mixer): make volume faders drag with the pointer#859LegionaryLeader wants to merge 2 commits into
LegionaryLeader wants to merge 2 commits into
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe audio mixer now uses a custom vertical fader with throttled drag commits, interaction-aware rendering, committed-value synchronization, updated visual states, and cache-busted script URLs. ChangesMixer fader interaction
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant CustomFader
participant setFaderValue
User->>CustomFader: Adjust fader
CustomFader->>setFaderValue: Commit value
setFaderValue-->>CustomFader: Return commit outcome
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The in-player mixer faders only jumped to the clicked spot and never tracked the mouse on drag; dragging the Song fader also stuttered playback. Root causes were engine-specific and stacked: - The faders were vertical <input type=range> elements. This app's Electron/ Chromium build renders a writing-mode vertical range but neither drags it with the pointer nor reflects programmatic .value changes (the older transform: rotate(-90deg) fallback broke hit-testing for the same reason). Horizontal native ranges work; vertical ones do not. - Every committed value re-rendered the whole popover (fader-value-changed, and for Song also participant-registered via _applySongVolume re- registration), tearing down the slider mid-drag after a single step. Replace the native range with a custom div fader (track/fill/thumb) driven from the pointer's Y position, backed by a hidden <input> so the existing set-fader-value commit path is unchanged. Guard the self-inflicted re-render while interacting, and throttle commits to ~20/sec (painting every move) so dragging Song no longer stutters playback. Harden fader min/max/step against non-numeric bounds and stop a late value-sync from yanking the thumb mid-drag. Cache-bust the audio-mixer.js include (?v=2) so clients pick up the new script instead of a stale cached copy. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: LegionaryLeader <legionaryleader@gmail.com>
LegionaryLeader
force-pushed
the
fix/mixer-fader-vertical-drag
branch
from
July 11, 2026 00:44
51d488b to
bf11320
Compare
Calling preventDefault() in the fader's pointerdown handler cancels the default focus, so a click left the fader unfocused and the arrow/Home/End keys did nothing until the user Tabbed to it. Focus the fader explicitly after preventDefault so keyboard adjustment works immediately after a click. Also set aria-valuetext alongside aria-valuenow so screen readers announce the formatted value with units (e.g. "-6 dB") instead of a bare number. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LegionaryLeader
marked this pull request as ready for review
July 11, 2026 01:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The in-player audio mixer's volume faders only jumped to where you clicked and never followed the mouse on drag. Dragging the Song fader also stuttered playback.
Root cause
Two stacked, engine-specific problems:
<input type="range">elements. This engine renders awriting-mode: vertical-lrrange but neither tracks the pointer on drag nor reflects programmatic.valuechanges. (The originaltransform: rotate(-90deg)fallback failed for the same underlying reason — hit-testing ran on the un-rotated geometry.) Horizontal native ranges work fine here; only vertical ones are broken.audio-mix:fader-value-changed, whose handler re-renders the entire popover — destroying the slider under the pointer after one step. The Song fader additionally re-registers itself on every change (_applySongVolume→participant-registered), so it broke even after the value-changed guard.Fix
<input type="range">so the existingset-fader-valuecommit path is reused unchanged.fader-value-changed,fader-unavailable,participant-registered,participant-removed) so a drag isn't torn down by its own commits._applySongVolumepath incl. native gain IPC).min/max/step, and a guard so a late value-sync can't yank the thumb back mid-drag.audio-mixer.jsinclude (?v=2) so clients load the new script instead of a stale cached copy.Files
static/audio-mixer.js— custom fader, throttle, re-render guardsstatic/style.css— fader visuals (track / fill / thumb)static/index.html,static/v3/index.html—?v=2cache-bustTesting
npm run test:js— 955/955 passSummary by CodeRabbit