Skip to content

fix(editor): the playability-lint popover can be closed again - #313

Merged
ChrisBeWithYou merged 2 commits into
mainfrom
fix/editor-lint-pop-close
Jul 19, 2026
Merged

fix(editor): the playability-lint popover can be closed again#313
ChrisBeWithYou merged 2 commits into
mainfrom
fix/editor-lint-pop-close

Conversation

@ChrisBeWithYou

@ChrisBeWithYou ChrisBeWithYou commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

The bug (tester report)

The orange triangle warning symbol at the bottom … opens a window that typically, for my charts at least, warns about legato related stuff. This window cannot be closed with an additional click of the warning ⚠️. And there is also no button present to close the pane that pops up. Refuses to go away unless a new chart is made or feedback is restarted. — Gloomii

That window is the playability-lint popover (#editor-lint-pop). This PR fixes both halves of the report: the popover that can't be closed, and the reason it's full of legato warnings in the first place.

Fix 1 — the popover can be closed again (CSS specificity)

The popover's base rule

#plugin-editor .editor-lint-pop { display: flex; ... }

is id+class specificity (1,1,0), which outranks the host's bare Tailwind utility .hidden { display: none } (0,1,0). Every close path — re-clicking the ⚠ chip, click-away, Escape, clicking an issue row — correctly adds the hidden class, but it has no visual effect: the popover stays on screen until the screen is rebuilt (new chart / restart), exactly as reported. The bug shipped with the lint feature itself: the editor's other popovers each carry an explicit override (.editor-menu-drop.hidden, .editor-transport-menu.hidden, .editor-mixer-drawer.hidden) — the lint pop was the one missing it.

  • assets/v3-theme.css: add #plugin-editor .editor-lint-pop.hidden { display: none; }, with a comment naming the specificity trap.
  • Since the report also calls out the missing close affordance, the popover header now renders an explicit ✕ close button (aria-labelled). It closes through editorToggleLintPopover() so the focus round-trip (close → focus returns to the chip) is preserved.

Fix 2 — the "legato related stuff" spam (the −1 sentinel)

Found while runtime-verifying fix 1 against a real pack: the legato-jump slide check gated on Number.isInteger(t.slide_to) only — but every note that has been through a save/load round trip carries slide_to: -1 (the wire's "no slide" default), so every loaded note above fret 3 flagged as Legato jump: slide N→-1 spans N+1 frets. That's why the tester's charts "typically" warn about legato. The rule now gates on slide_to >= 0, the same read draw.js / commands.js / context-menu.js already use.

Tests

  • tests/lint_pop_close.test.mjs (new) — a CSS guard pinning the .hidden override + DOM-stub tests for the toggle round-trip, the ✕ close, and stray-click behavior. All four fail on main.
  • tests/playability_lint.test.mjs — new assertion: a note with slide_to: -1 must not flag. Fails on main.
  • npm test: 210 pass / 0 fail. npm run lint: 0 errors.

Runtime verification (real host)

Served this branch through the core host with a fixture pack whose Lead part has a genuine legato jump (fret 3 → 10 hammer-on), driven with Playwright:

  • chip shows ⚠ 1 (was ⚠ 2 before fix 2 — the extra one was the bogus slide 10→-1 row)
  • chip click opens the popover; ✕ closes it; chip re-click closes it; click-away closes it — all verified against computed style, not just the class list.

🤖 Generated with Claude Code

https://claude.ai/code/session_01929LgKdJMyPGLf8N1WpEVW

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ChrisBeWithYou, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3688cbf9-dcee-4d65-9571-010f6b71e779

📥 Commits

Reviewing files that changed from the base of the PR and between d62ae4e and ac5b962.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • assets/v3-theme.css
  • src/playability-lint.js
  • tests/lint_pop_close.test.mjs
  • tests/playability_lint.test.mjs
📝 Walkthrough

Walkthrough

The playability-lint popover now includes an explicit close button, hides reliably through its .hidden class, restores chip focus, and preserves existing chip-toggle behavior. New tests cover rendering, accessibility state, close interactions, internal clicks, and CSS visibility.

Changes

Playability lint popover

Layer / File(s) Summary
Popover header and close control
src/playability-lint.js, assets/v3-theme.css
The popover header renders a dedicated close button, with flex layout, close-button styling, and a .hidden rule that forces the popover to be hidden.
Close-button interaction
src/playability-lint.js
Clicks on the close button toggle the popover closed and bypass row seek/select behavior.
Close behavior validation and changelog
tests/lint_pop_close.test.mjs, CHANGELOG.md
Tests verify opening, closing, focus restoration, ARIA state, ignored internal clicks, chip toggling, and CSS visibility; the changelog records the fix.

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

Possibly related PRs

Suggested reviewers: byrongamatos

🚥 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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing the playability-lint popover so it can be closed again.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/editor-lint-pop-close

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.

ChrisBeWithYou and others added 2 commits July 19, 2026 00:38
The lint popover's base style (#plugin-editor .editor-lint-pop) sets
display:flex at id+class specificity, which outranks the bare .hidden
utility every close path relies on. So re-clicking the warning chip,
clicking away, Escape, and clicking an issue row all added the class
correctly while the popover stayed visible on screen — it survived until
a new chart was made or the app restarted (as reported by a tester whose
charts flag legato jumps). The bug shipped with the lint feature itself:
the menu, transport, and mixer popovers each carry an explicit .hidden
override; this one never did.

- add the `.editor-lint-pop.hidden { display: none; }` override
- add an explicit visible close affordance: a ✕ button in the popover
  header (aria-labelled, closes via the same toggle path so focus
  returns to the chip)
- tests/lint_pop_close.test.mjs: a CSS guard pinning the override (fails
  on main) + DOM-stub tests for the toggle round-trip, the ✕ close, and
  stray-click behavior — all four fail on main

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01929LgKdJMyPGLf8N1WpEVW
Signed-off-by: ChrisBeWithYou <chris@rifflarr.local>
…l as a slide

Found while runtime-verifying the popover fix: the slide-reach check
gated on Number.isInteger(t.slide_to) only, but every note that has been
through a save/load round trip carries slide_to: -1 (the wire's "no
slide" default) — so every loaded note above fret 3 flagged as
"Legato jump: slide N→-1 spans N+1 frets". That sentinel spam is the
"warns about legato related stuff" in the tester report. Gate on
slide_to >= 0, the same read draw.js / commands.js / context-menu.js
already use.

Verified against a real pack through the host: the lint chip drops from
2 issues (1 bogus) to the 1 genuine hammer-on jump.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01929LgKdJMyPGLf8N1WpEVW
Signed-off-by: ChrisBeWithYou <chris@rifflarr.local>
@ChrisBeWithYou
ChrisBeWithYou force-pushed the fix/editor-lint-pop-close branch from f02f03f to ac5b962 Compare July 19, 2026 05:38
@ChrisBeWithYou
ChrisBeWithYou merged commit 8726ad5 into main Jul 19, 2026
@ChrisBeWithYou
ChrisBeWithYou deleted the fix/editor-lint-pop-close branch July 19, 2026 05:38
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