Repository navigation
feat(gui): click a synced lyric line to seek there - #853
Conversation
A synced line is a real button inside the <li> that sends one SeekTo with the line's start time; only the sung line holds the tab stop, and lines without synced timing stay plain text. The Lyrics page and the full screen Room share a new hook-free LyricText component. Fixes LargeModGames#844
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Fixes #844
What
A synced lyric line is now a button: clicking it, or focusing it with Tab and pressing Enter or Space, sends one SeekTo with the line's start time. This works on the Lyrics page and in the full screen Room, which share a new hook-free LyricText component, so both stay testable through byName. Only the line being sung holds the tab stop, so Tab reaches the lyrics exactly once instead of once per line. Lines without synced timing stay plain text, as before, and a dropped connection guards inside onClick instead of disabling the buttons, so the lyrics don't fade.
The CSS makes the button look exactly like the text it replaces: no padding, border or background, inherited letter spacing, left alignment, with an underline on hover and the browser's focus ring kept.
How Tested
gui/src/lyricText.test.tsx: a click on a synced line sends[{ SeekTo: 4000 }], a dropped connection sends nothing, an estimated line renders as plain textgui/src/lyricsPage.test.tsx: the three markup strings updated for the button inside the<li>, plus a new test that exactly onetabindex="0"sits on the sung line; the unsynced case now also asserts no<buttongui/src/room.test.tsx: new synced case expecting alyric-seekbutton; the existing estimated-lyrics test passes unchangednpm test398 passed / 0 failed,npm run lint,npm run format:check,npm run typecheck,npm run buildall cleannpx playwright test --project=chromium(the shots suite) 42 passed; the lyrics screenshot is byte-identical to the one from main, which is the point of the CSS: the button looks like the text it replaces. Both PNGs are attached (before from main, after with this change)Not checked by hand in the running app: no interactive session was available here. The click path, the keyboard path and the markup are covered by the tests above, and the seek action itself is the same one the seek bar already sends.
The lyrics page before and after (byte-identical screenshots, which is the point of the CSS: the button looks exactly like the text it replaces):
Before (main):
After (this change):