Skip to content

highway: make the missed-note gem visible + provider-color-driven - #1061

Open
ahonnecke wants to merge 1 commit into
got-feedBack:mainfrom
ahonnecke:highway-miss-visible
Open

highway: make the missed-note gem visible + provider-color-driven#1061
ahonnecke wants to merge 1 commit into
got-feedBack:mainfrom
ahonnecke:highway-miss-visible

Conversation

@ahonnecke

@ahonnecke ahonnecke commented Aug 6, 2026

Copy link
Copy Markdown

Problem

The note-state provider (feedBack#254) lets a scorer flag a note 'miss', but _paintGemGlow rendered every miss as one hardcoded-red circle at globalAlpha = 0.4·alpha, drawn over the gem at r·1.05:

  • It ignored the provider's color (which hit/active already honor), so a scorer can't choose a non-colliding hue. The hardcoded red also sits directly on the E string's own color (#ff3c3c in DEFAULT_STRING_BRIGHT), so a missed low-E note is unreadable.
  • At 0.4α over a same-size circle — with the provider's short transient alpha — a miss is effectively invisible.

Change

_paintGemGlow's miss branch now:

  • Honors ns.color — parsed into the radial-glow stops (fallback purple #c04bff, deliberately away from the red E string).
  • Renders a radial glow to r·2.1 + a crisp ring at r·1.2 so a missed note reads at a glance the whole way down the highway.
  • Keeps the center tint light (0.32α) so the note colour + fret number (drawn on top by the caller) stay readable.

One file, static/js/highway-state-primitives.js. No API or contract change — a provider that returns a bare 'miss' (no color) simply gets the purple default; one that returns { state:'miss', color } gets its color.

Pairs with a companion note_detect change that makes misses persist across a play (so they light up as the note approaches on the next loop/play), but this render fix stands alone.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style
    • Improved the visual effect for missed notes with brighter, provider-selected colors.
    • Added a larger glow and crisp ring while preserving note readability.
    • Adjusted effect intensity for more consistent rendering.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7cb0337a-6731-408b-ba60-0aee3958f8ca

📥 Commits

Reviewing files that changed from the base of the PR and between eef58c8 and 3466a3f.

📒 Files selected for processing (1)
  • static/js/highway-state-primitives.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • static/js/highway-state-primitives.js

📝 Walkthrough

Walkthrough

The missed-note effect now uses the configured provider color, a larger radial glow, and a wider outlined ring. Glow and ring opacity scale with normalized alpha. A purple fallback applies when color parsing fails.

Changes

Missed Note Rendering

Layer / File(s) Summary
Provider-colored miss effect
static/js/highway-state-primitives.js
_paintGemGlow now renders missed notes with a provider-colored radial glow and outlined ring. The effect uses a purple fallback, scales opacity with ns.alpha, and preserves note readability.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description clearly explains the problem and implementation, but it omits the required feedpak surface and checklist sections. Add the required feedpak surface declaration and checklist entries for CHANGELOG.md, tests, and DCO sign-off.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change to make missed-note gems visible and provider-color-driven.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

🧹 Nitpick comments (1)
static/js/highway-state-primitives.js (1)

95-99: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Update the stale color description.

The comment still describes the effect as red. The implementation now uses ns.color with a #c04bff fallback.

Proposed comment update
-        // Bold, unmissable red so a missed note reads at a glance the whole way
+        // Bold, provider-colored glow so a missed note reads at a glance the whole way
🤖 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 `@static/js/highway-state-primitives.js` around lines 95 - 99, Update the
nearby rendering comment to describe the current ns.color-based effect and its
`#c04bff` fallback instead of referring to a red color, while preserving the
existing notes about the glow, ring, and readable overlaid note content.
🤖 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 `@static/js/highway-state-primitives.js`:
- Around line 104-117: Update the color handling around the glow gradient and
ring draw to compute one validated, normalized hex color with the purple
fallback, then reuse that value for RGB extraction and hwState.ctx.strokeStyle.
Remove the separate raw ns.color fallback so invalid input produces the same
fallback color for both draws.

---

Nitpick comments:
In `@static/js/highway-state-primitives.js`:
- Around line 95-99: Update the nearby rendering comment to describe the current
ns.color-based effect and its `#c04bff` fallback instead of referring to a red
color, while preserving the existing notes about the glow, ring, and readable
overlaid note content.
🪄 Autofix

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: d4d0f476-6f3e-43ee-89c0-890c2b33b832

📥 Commits

Reviewing files that changed from the base of the PR and between eef58c8 and 39e0d21.

📒 Files selected for processing (1)
  • static/js/highway-state-primitives.js

Comment thread static/js/highway-state-primitives.js Outdated
The note-state provider (feedBack#254) lets a scorer flag a note 'miss', but
`_paintGemGlow` rendered every miss as a single hardcoded-red circle at
globalAlpha 0.4·alpha over the gem. Two problems:

1. It ignored the provider's `color` (which hit/active already honor), so a
   scorer can't pick a non-colliding hue — and the hardcoded red sits right on
   top of the E string's own color (#ff3c3c), making a missed E unreadable.
2. At 0.4α over a same-size circle, with the provider's short transient alpha,
   a miss is effectively invisible.

Now the miss glow honors `ns.color` (parsed for the radial-glow stops, fallback
purple — deliberately away from the red E string), and renders a radial glow
spilling to r·2.1 plus a crisp ring at r·1.2 so a missed note reads at a glance.
Center tint stays light (0.32α) so the note colour + fret number (drawn on top)
remain readable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@ahonnecke
ahonnecke force-pushed the highway-miss-visible branch from 39e0d21 to 3466a3f Compare August 6, 2026 22:36
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@ahonnecke

Copy link
Copy Markdown
Author

Addressed in the latest push — the miss glow and ring now derive from a single validated hex (an invalid ns.color falls back to purple for both, instead of only the glow).

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.

1 participant