Study-mode + a11y follow-up fixes (unscored study, focus-gating, play() guard) - #19
Conversation
|
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)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughStudy mode now tracks active instances, hides Core’s live HUD while studying, blocks free-play scoring side effects, and adds split-screen focus/audio guards. The release also updates accessibility attributes, changelog notes, and version numbers. ChangesStudy Mode Isolation
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
screen.js (1)
4472-4502: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winReset
_svWasAudioPausedwhen focus is lost
_svUpdateFocusState()stops updating_svWasAudioPausedwhile a panel is unfocused, so the next focused frame can misread the shared audio’s current play state as a stale pause→play edge and trigger an unnecessary pause/count-in. Clear_svWasAudioPausedin the focus-loss branch so the first focused frame re-observes the current state.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@screen.js` around lines 4472 - 4502, Reset the shared audio state tracker when focus is lost so stale state does not trigger a false pause→play transition on refocus. Update the focus-loss branch in _svUpdateFocusState to clear _svWasAudioPaused, ensuring the next focused draw() frame re-observes the current audio.paused value before any preroll logic runs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@screen.js`:
- Around line 4472-4502: Reset the shared audio state tracker when focus is lost
so stale state does not trigger a false pause→play transition on refocus. Update
the focus-loss branch in _svUpdateFocusState to clear _svWasAudioPaused,
ensuring the next focused draw() frame re-observes the current audio.paused
value before any preroll logic runs.
…l volume slider - Study mode's preroll/gate-pause loop and its `seeked` handler now run only when `_svIsFocused`, so in split-screen two Study panels stop fighting over the shared `#audio` element (single-panel is unaffected — always focused). - `audio.play()` in `_svStudyAdvance` and the preroll `onDone` now catch a rejected play() promise (autoplay policy / decode error) and reset `_svPrerollResuming`, instead of leaving playback silently stuck. - The monitor-synth volume slider gets an `aria-label`/`title` so screen readers no longer announce it as an unlabeled slider. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: gionnibgud <gionnibgud@gmail.com>
… scoreboard Study is note-by-note guided practice: a gate only advances once played correctly, so a run is always ~100%. Feeding that into the scoreboard made the per-hand line read a meaningless (and, after a study seek-back, corrupted) 100%, and pushed fake ~100% "performances" into core's live HUD and song_stats. Decouple study from free-play scoring entirely: - `_svStudyHandleNoteOn` no longer mutates the free-play tallies (`_svHits`/`_svMisses`/per-hand), claims notes in the sweep sets, or emits `note:hit`/`note:miss`. It only advances the gate, reports to the note-detection domain (observability), and tracks wrong-note X marks. - Guard `_svSweepMisses` out of study — the free-play time-sweep and its `_svHandleSeek` rollback must not run there (that was corrupting the tally on a study seek-back). - Guard `_svEmitNoteResult` in study (belt-and-suspenders) so nothing reaches core's scoring bus / dashboard. - Suppress the red free-play miss-dots in study; the surface shows only study's own orange wrong-note X marks. - Hide core's `#v3-live-performance-hud` while study is active via a new `staffview-study-active` class + CSS rule (mirrors the notation-active plumbing), and guard the per-hand line off too. Net: free-play counters stay frozen and aligned with core across study↔free-play transitions, fixing the "100% on a hand I didn't reach" divergence at the root. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: gionnibgud <gionnibgud@gmail.com>
…reroll) CodeRabbit review on #19: the study preroll/gate-pause block in draw() is gated on _svIsFocused, so an unfocused instance's _svWasAudioPaused freezes. If the shared audio's play state actually changes while unfocused, the stale value can misread as a pause->play edge on refocus and fire a false preroll mid-playback. Null it in the focus-loss branch of _svUpdateFocusState so the first refocused frame just re-observes current state. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: gionnibgud <gionnibgud@gmail.com>
a51fac6 to
234906c
Compare
Adds a Fixed section for this branch's three commits: unscored-practice decoupling (+ the free-play/study sweep collision it fixes), split-screen study focus-gating (+ the stale pause/play edge reset), and the play() promise-rejection guard / volume-slider a11y label. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: gionnibgud <gionnibgud@gmail.com>
Code reviewSolid PR — both commits verified against the branch code. Verified correct:
Findings:
Fixes for both incoming on this branch. 🤖 Generated with Claude Code |
Review follow-ups on this branch: - Extract _svStudyRehomeGate and call it on focus gain — a seek while unfocused is ignored by the study seeked handler, leaving a stale _svStudyGateIdx on refocus (audio ran uncontrolled past gates or paused at the wrong spot). - Fix stale _svStudyHandleNoteOn header comment still claiming study feeds core stats. - Bump 0.2.0 -> 0.3.0 (unreleased section adds features: study mode, detection controls); date the changelog entry, align its study-mode Added text with unscored study. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Study-mode + a11y follow-up fixes
Post-merge follow-ups to the staffview stack (#8–#16). Two commits, both off
current
main. Several review items from the first round were already fixedupstream (zoom-clamp
9497872, velocity gain70889a9, counter-rollbackfc36b9c) — this PR only carries what's still missing.Commit 1 —
fix(study,a11y)draw()and theseekedhandler now run only when_svIsFocused. The shared#audioelement is driven by every instance'sdraw()loop, so insplit-screen two Study panels were fighting over one track. Single-panel is
unaffected (
_svIsFocusedis always true there).audio.play()promise rejection in_svStudyAdvanceand thepreroll
onDone— a rejected play() (autoplay policy / decode) no longerleaves playback stuck with
_svPrerollResumingpinned true.aria-label/titleso it isn't announced as anunlabeled slider.
Commit 2 —
fix(study): study mode is unscored practiceWhy scoring doesn't make sense in study: study is note-by-note guided
practice — a gate only advances once you play it correctly, so every run is
necessarily ~100%. Feeding that into the scoreboard meant:
study seek-back, because the free-play sweep/
_svHandleSeekrollback wasstill running under study's gate accounting), and
song_stats/ the dashboard.So study is now fully decoupled from free-play scoring:
_svStudyHandleNoteOnno longer mutates the free-play tallies, claims notesin the sweep sets, or emits
note:hit/note:miss— it only advances thegate, reports to the note-detection domain (observability, kept), and
tracks wrong-note X marks.
_svSweepMisses(and its_svHandleSeekrollback) is guarded out of study._svEmitNoteResultis guarded in study (belt-and-suspenders).show.
#v3-live-performance-hudis hidden in study via a newstaffview-study-activeclass + one CSS rule (mirrors the existingnotation-active plumbing); the per-hand line is guarded off too.
Net: free-play counters stay frozen and aligned with core across
study↔free-play transitions — fixing the "100% on a hand I didn't reach"
divergence at the root rather than patching the display.
@byrongamatos — commit 2 changes how study integrates with core (study was
routed through core note-detection by team direction, and you wrote the gate
refactor +
fc36b9c). Study still reports to the note-detection domain; itjust no longer scores. Flagging for your call on whether unscored-study is the
behaviour we want.
Verification
keyboard: study gate-pause/preroll/X-marks work, core HUD hides in study and
returns on exit, study + seek-back no longer shows bogus per-hand, and a
free-play run after study scores cleanly (no leaked study counts).
npm testgreen (104/104).🤖 Generated with Claude Code
Summary by CodeRabbit