Skip to content

feat(gui): click a synced lyric line to seek there - #853

Merged
LargeModGames merged 1 commit into
LargeModGames:mainfrom
niukanen1:gui-lyric-click-844
Oct 15, 2026
Merged

LargeModGames merged 1 commit into
LargeModGames:mainfrom
niukanen1:gui-lyric-click-844

Conversation

@niukanen1

@niukanen1 niukanen1 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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

  • new 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 text
  • gui/src/lyricsPage.test.tsx: the three markup strings updated for the button inside the <li>, plus a new test that exactly one tabindex="0" sits on the sung line; the unsynced case now also asserts no <button
  • gui/src/room.test.tsx: new synced case expecting a lyric-seek button; the existing estimated-lyrics test passes unchanged
  • all three fail on main before the change (verified by stashing the production files and running the tests)
  • npm test 398 passed / 0 failed, npm run lint, npm run format:check, npm run typecheck, npm run build all clean
  • npx 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):

lyrics page on main

After (this change):

lyrics page with this change

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

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LargeModGames/spotatui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7468bd49-4d1e-4f8b-9bf3-f811e1b3454a
📥 Commits

Reviewing files that changed from the base of the PR and between d8df4bd and 8912087.

📒 Files selected for processing: 9
  • CHANGELOG.md
  • gui/src/LyricText.css
  • gui/src/LyricText.tsx
  • gui/src/LyricsPage.tsx
  • gui/src/Room.tsx
  • gui/src/Shell.tsx
  • gui/src/lyricText.test.tsx
  • gui/src/lyricsPage.test.tsx
  • gui/src/room.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Synced lyric lines now render as seek buttons in the Lyrics page and full-screen Room. Clicking a line sends SeekTo with its start time when connected. Unsynced lines remain plain text, and the current lyric line is the only tab stop.

Changes: Synced lyric seeking

Layer / File(s) Summary
Shared lyric seek control
gui/src/LyricText.tsx, gui/src/LyricText.css, gui/src/lyricText.test.tsx
LyricText renders synced lines as buttons and sends SeekTo with the line’s start time when connected. Unsynced lines render as plain text. Tests cover both states and click behavior.
Lyrics page integration
gui/src/LyricsPage.tsx, gui/src/Shell.tsx, gui/src/lyricsPage.test.tsx
The Lyrics page uses LyricText, receives connection state and the action sender, and sets the current line as the tab stop. Tests cover synced and unsynced rendering and the single tab stop.
Full-screen Room integration
gui/src/Room.tsx, gui/src/room.test.tsx, CHANGELOG.md
Room passes connection state and the action sender to its lyric rows. A test checks synced lyric rendering. The changelog describes the lyric interactions.

Priority: ➖ Normal

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant LyricText
  participant send
  User->>LyricText: Click synced line
  LyricText->>send: Send SeekTo(line.at_ms) when connected
Loading
Merge Risk: ⚪ Minimal · up to 89120

Synced lyric lines become seek buttons on the Lyrics page and in the Room. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed The PR meets the coding requirements for directly linked issue #844. LyricText renders synced lines as real buttons and sends { SeekTo: line.at_ms } only when connected. Unsynced and estimated lin…
Out of Scope Changes check Passed The changes stay within issue #844. LyricText.css preserves lyric appearance and focus behavior. Propagation of connected and send supports the new click behavior. The LyricText, LyricsPage, and…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the allowed conventional-commit prefix feat(gui):, clearly describes the main change, and uses a concise imperative subject.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
✨ Simplify code
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit 5e48862 into LargeModGames:main Oct 15, 2026
32 checks passed
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.

GUI: click a synced lyric line to jump there

2 participants