Skip to content

fix(highway_3d): Venue desync, bind race, and a11y for the player background control - #1018

Merged
byrongamatos merged 6 commits into
mainfrom
fix/highway-3d-bg-control-followup
Jul 20, 2026
Merged

byrongamatos merged 6 commits into
mainfrom
fix/highway-3d-bg-control-followup

Conversation

@Elit3d

@Elit3d Elit3d commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What

Follow-up to #1008 (mid-song background controls in the player chrome), addressing post-merge review feedback:

  • Venue desync — the control read the stored background style, not the effective one. While the Venue scene override is active, _bgMountStyle resolves to venue regardless of what the dropdown shows, so picking a style did nothing and looked broken. The whole Background group (dropdown, Reactive, Intensity) now goes inert with a reason on hover while Venue is active, and resyncs correctly when it toggles off.
  • Cold-load bind race — the screen:changed re-mount hook only tried to bind once; on a cold load where the event bus wasn't ready yet, the control could mount but stay permanently deaf to player-chrome rebuilds for the session. It now retries the bind alongside the mount retry.
  • Global-read correctness — replaced _bgReadSetting(null, key) (which worked by relying on a 'h3d_bg_null_<key>' storage key never existing) with an explicit _bgReadGlobal(key) helper, so the shared control's intent to always read the global slot is stated directly rather than implied.
  • Accessibilityaria-pressed on the Reactive toggle, aria-describedby pointing disabled controls at a visually-hidden reason (previously title-only, which screen readers announce unreliably and touch doesn't surface at all), and aria-label on the style select and intensity slider.
  • v3 UI gate_pcSlot() now explicitly checks window.feedBack.uiVersion === 'v3' per docs/plugin-v3-ui.md, matching the pattern the tuner plugin already follows.

feedpak surface

  • This PR does not change how the app reads/writes feedpaks (manifest keys, pack files, folder layout)

Checklist

  • CHANGELOG.md [Unreleased] updated (user-visible changes)
  • Tests added/updated for new behaviour
  • Commits are DCO signed off (git commit -s)

Summary by CodeRabbit

  • New Features

    • Background controls in the 3D Highway player now consistently use global background settings.
    • Improved accessibility: disabled-state explanations are exposed to screen readers, and control toggle states are announced correctly.
  • Bug Fixes

    • Background controls disappear when a non-3D renderer is selected.
    • Background controls are greyed out and inert while a Venue scene override is active, and UI refresh now correctly tracks Venue changes.
    • More robust initialization so the background controls don’t become unresponsive during async load.
  • Documentation

    • Clarified the unreleased changelog entry for background control behavior under Venue and renderer changes.
  • Tests

    • Expanded background control coverage, including accessibility and retry behavior.

Elit3d added 4 commits July 19, 2026 19:03
When the Venue visualization override is active, the entire Background control group (style dropdown and intensity/reactive knobs) is now disabled since the venue scene owns rendering. The dropdown, intensity, and reactive controls are greyed out with a tooltip explaining the state.

Also fixes a cold-load bug where the screen hook subscription could fail to bind if the event bus wasn't ready during renderer init, by re-attempting binding on each retry tick.

Includes test coverage for both the Venue override greyout behavior and the cold-load screen hook binding fix.
…ntrol

Refactor the player chrome background control to use an explicit `_bgReadGlobal()` function instead of relying on the implicit behavior of `_bgReadSetting(null, ...)`. The control is a single shared instance across splitscreen panels and must always read/write the global slot.

Add accessibility improvements:
- aria-pressed on toggle buttons to expose state to screen readers
- aria-label on select and intensity controls
- aria-describedby pointing disabled controls to a visually-hidden reason span
- The reason span carries dynamic explanatory text for why a control is greyed out

Add comprehensive tests verifying the new `_bgReadGlobal` helper ignores per-panel overrides and that all accessibility attributes are set and updated correctly.
Add explicit check for `window.feedBack.uiVersion === 'v3'` in _pcSlot() per docs/plugin-v3-ui.md. This prevents the plugin from attempting to mount player controls on non-v3 hosts (e.g., legacy v2 shell). Complements the existing `playerControlSlot` typeof check and improves compatibility robustness.

Updated test mocks to include `uiVersion: 'v3'` and added test case verifying that mounting is skipped when uiVersion is not v3, including a guard to ensure the retry loop terminates properly.
Document that the style controls group also greyes out when the Venue scene override is active, since the controls don't apply in that mode.
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a8585f1-cd25-4939-b75a-e7b9fc37dbd2

📥 Commits

Reviewing files that changed from the base of the PR and between e71c578 and 1cfaf84.

📒 Files selected for processing (2)
  • plugins/highway_3d/screen.js
  • plugins/highway_3d/tests/background_control.test.js

📝 Walkthrough

Walkthrough

The 3D Highway background controls now read global settings, become inert under the Venue scene override, expose updated accessibility state, retry late initialization, and include expanded tests. The changelog and plugin version were updated to reflect the release.

Changes

3D Highway background controls

Layer / File(s) Summary
Global background control behavior
plugins/highway_3d/screen.js
Global style, reactive, and intensity values are read consistently, while Venue overrides make the full background group inert.
Accessibility and lifecycle wiring
plugins/highway_3d/screen.js
ARIA attributes, shared disabled-state descriptions, Venue re-synchronization, retry binding, and cleanup behavior were added or updated.
Behavior validation and release metadata
plugins/highway_3d/tests/background_control.test.js, CHANGELOG.md, plugins/highway_3d/plugin.json
Tests cover global reads, delayed binding, UI gating, accessibility, and Venue behavior; release notes and the plugin version were updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant PlayerBackgroundControls
  participant GlobalBackgroundSettings
  participant VenueScene
  User->>PlayerBackgroundControls: change background control
  PlayerBackgroundControls->>GlobalBackgroundSettings: read or write global setting
  VenueScene-->>PlayerBackgroundControls: publish venueScene change
  PlayerBackgroundControls->>PlayerBackgroundControls: disable group and update ARIA state
Loading

Possibly related PRs

Suggested reviewers: byrongamatos, chrisbewithyou

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the PR’s main changes: Venue desync, bind retry race, and accessibility fixes for the background control.
Description check ✅ Passed The description includes the required What, feedpak surface, and Checklist sections and covers the main changes well.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/highway-3d-bg-control-followup

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.44.1)
plugins/highway_3d/screen.js

ast-grep timed out on this file


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
No server is currently available to service your request. Sorry about that. Please try resubmitting your request and contact us if the problem persists.

@Elit3d

Elit3d commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor
Action performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@plugins/highway_3d/screen.js`:
- Around line 4184-4225: Update the _pcSync() logic for _pcSel so its title is
restored to the mount-time base tooltip, “Background style”, whenever Venue mode
is inactive, while retaining why as the title during Venue mode. Match the
existing title behavior used by the intensity control and preserve the
aria-disabled and visual state handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e7a32a46-6486-4731-896e-eb50e4e84e25

📥 Commits

Reviewing files that changed from the base of the PR and between 35c0d0e and e71c578.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • plugins/highway_3d/plugin.json
  • plugins/highway_3d/screen.js
  • plugins/highway_3d/tests/background_control.test.js

Comment thread plugins/highway_3d/screen.js
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
No server is currently available to service your request. Sorry about that. Please try resubmitting your request and contact us if the problem persists.

Elit3d and others added 2 commits July 19, 2026 21:03
The style dropdown's tooltip was cleared whenever the Venue override was inactive, permanently discarding the "Background style" hint set at mount time. Since the sync runs on every settings change, the tooltip was lost on the first sync and never returned.

This brings the dropdown in line with the intensity slider and reactive toggle, which already restore their base tooltip when they're re-enabled.

Includes a test asserting the tooltip returns after the Venue override exits.
_pcAcquire only runs once the renderer is viable inside the v3 player
chrome, and player-chrome.js sets uiVersion synchronously as it builds
that chrome — so a missing 'v3' at acquire means v2, not a not-yet-ready
v3. Bail before scheduling the retry loop instead of spinning it out to
the ~3s budget for a slot that will never appear.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: byrongamatos <xasiklas@gmail.com>
@byrongamatos
byrongamatos merged commit a9be210 into main Jul 20, 2026
5 checks passed
@Elit3d
Elit3d deleted the fix/highway-3d-bg-control-followup branch July 20, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants