feat(editor): grid-health pill in the transport LCD — Map Health at a glance, click to fix - #268
Conversation
|
Warning Review limit reached
Next review available in: 28 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds a configurable Grid health LCD cell that summarizes judgeable Map Health bars, hides when Map Health is disabled, and navigates to the worst drifting bar. Shared navigation logic and pure selector tests support the feature. ChangesGrid health transport integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant TransportBar
participant MapHealth
participant Ruler
participant Editor
TransportBar->>MapHealth: Calculate Grid health pill
TransportBar->>MapHealth: Select worst drifting measure
TransportBar->>Ruler: Request measure navigation
Ruler->>Editor: Arm fitting and seek to measure
Editor-->>TransportBar: Refresh status and transport display
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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 `@src/transport-bar.js`:
- Around line 473-482: Update the editor-lcd-grid handler around
_mapHealthWorstPure and _mapHealthResults to distinguish a neutral no-verdict
result from all judgeable bars agreeing. When every measure is grey, show a
no-verdict status message; reserve the existing “every judgeable bar agrees”
message for the case where judgeable measures exist and none need fixing, while
preserving navigation to _mapHealthGotoMeasure for a returned worst measure.
🪄 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: b9004d87-1ad0-4503-a842-22276906a417
📒 Files selected for processing (6)
CHANGELOG.mdsrc/map-health.jssrc/ruler.jssrc/transport-bar.jstests/count_lcd.test.mjstests/map_health_pill.test.mjs
7d1090e to
43a111e
Compare
|
Applied in 64c6c83 — good catch: Also fixed in 43a111e (my own review, not yours): the pill's colour write guarded on |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai full review |
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 30 minutes. |
Map Health polish: while the Tempo/Grid Map Health toggle is on, a new Grid LCD cell shows the percent of judgeable bars agreeing with the recording (grey never counts either way; no verdict = dash, never a fake 100%), coloured by the worst band present. Clicking it jumps to the worst drifting bar with the fix armed via the factored _mapHealthGotoMeasure (shared with the wash click-through). Cell hides with the lens off; Customize row can hide it independently. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q
`gridEl.style.color !== color` never matched: the DOM normalizes an assigned '#ef4444' back to 'rgb(239, 68, 68)', so the skip-if-unchanged guard was always true and the inline style got re-written on every transport tick — the exact per-frame churn the _set() guards elsewhere in the tick exist to avoid. Compare the band string instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
_mapHealthWorstPure() returns null for two different reasons — nothing is drifting, or nothing is judgeable at all. The pill already tells them apart (a dash, never a fake 100%); the click's status line did not, and told a nothing-to-judge song that every bar agrees with the recording. Split the two on the pill verdict. (CodeRabbit) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
An agent worktree symlinked node_modules; .gitignore only lists node_modules/ (trailing slash), which matches a directory but not a symlink, so git add -A tracked it. The symlink pointed at a local absolute path and would break any other checkout.
6b746a7 to
f333833
Compare
What
The Map Health polish pack's first half, built to Christian's calls ("percent + color, click to fix", "toggleable from the menu bar"):
_mapHealthGotoMeasure, factored out of the wash click-through so both surfaces share one motion (and the pill works even when the strip is scrolled out of view). Nothing drifting? The click says so instead of jumping._mapHealthResults()is already memoized on editGen + the onset cache, so a visible pill costs a map lookup per LCD tick; the O(bars × beats) scan only reruns after an actual edit.Tests
tests/map_health_pill.test.mjs(4, fail on main): judgeable-only percent (grey neither dilutes nor inflates), worst-band colouring, the no-verdict dash, and the worst-bar ranking (red > amber, drift tiebreak, null when clean).count_lcd.test.mjs's cell-order pin deliberately updated for the new cell (the prefs helper already keeps cells added after a saved pref visible by default — pinned there). Full suite 147 green, lint 0 errors,routes.pyuntouched.Live-verified
Real project: lens off → cell hidden; lens on → "29%" in red (this pak's grid genuinely disagrees — it's the drift-diagnosis project); click → "Bar 39 drifts 39% from the recording — Tempo Map opened; press G to fit the barlines from here" with the anchor set on that bar. Zero page errors.
🤖 Generated with Claude Code
https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q
Summary by CodeRabbit
New Features
Bug Fixes