Skip to content

Fix v3 Songs A–Z rail: reliable taps, precise drag, hittable size#653

Merged
byrongamatos merged 2 commits into
mainfrom
fix/v3-az-rail-pointer-scrub
Jul 2, 2026
Merged

Fix v3 Songs A–Z rail: reliable taps, precise drag, hittable size#653
byrongamatos merged 2 commits into
mainfrom
fix/v3-az-rail-pointer-scrub

Conversation

@ChrisBeWithYou

Copy link
Copy Markdown
Contributor

Follow-up to #634 (the A–Z fast-scroll rail). Three bugs reported on macOS + Windows (0.3.0, 2026-06-29 — =Scr4tch=, MajorMokoto):

"Clicking the letters works unreliably… I clicked O and nothing happened. When I clicked and dragged on O it brought me to the H's… where you release is not where you get sent." — =Scr4tch=
"Appears to be way too small. 1440p at fullscreen. Resolution change doesn't impact its size. It is also not responsive when clicking — only sometimes jumps to the letter clicked." — MajorMokoto

Root causes & fixes

All in static/v3/songs.js (bindRailOnce / jumpToLetter) + static/v3/v3.css (.v3-azrail).

  1. Taps often did nothing. pointerdown calls setPointerCapture, after which the browser retargets the follow-up click to the rail container — so the click handler's closest('.v3-azrail-letter') resolved null, and a plain tap (no pointermove) had no other code path → no-op. The jump is now driven from pointerdown itself (seek on press); the click handler is reduced to keyboard activation only (e.detail === 0, i.e. Enter/Space).

  2. A drag landed short of the release. Every letter crossed fired jumpToLetter with behavior:'smooth'; stacked smooth-scroll animations over the virtualized grid lagged and settled imprecisely. jumpToLetter(letter, smooth) now scrolls instantly ('auto') while scrubbing and animates only discrete taps/keyboard jumps — so the grid tracks the finger and the release lands on the let-go letter.

  3. Too small / didn't scale. Letters were a fixed .62rem glued at right:2px (~13px-tall target on the screen edge). They now scale with the viewport (clamp(.72rem, 1.4vh, 1.05rem)), sit off the edge with taller/wider equal-width hit targets and a hover/active highlight so the scrub target is visible. The short-viewport media query is kept (clamped).

Keyboard arrow-nav and present-letter gating are unchanged.

Testing

  • tests/js/v3_az_rail.test.js gains assertions pinning: pointerdown-seek, the keyboard-only (detail === 0) click guard, and instant-vs-smooth scrolling.
  • Full JS suite: 809 tests, 796 pass, 13 fail — the 13 failures are pre-existing on main (colour-facade / viz-attribution / loop-seek; unrelated to the rail) and unchanged by this PR.
  • node --check static/v3/songs.js passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QbexxfTt8q2tAn436MqGWF

byrongamatos added a commit that referenced this pull request Jul 2, 2026
…review)

Right- or middle-clicking the A–Z rail (or a secondary multi-touch
pointer) no longer triggers a seek; only the primary tap/drag scrubs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
byrongamatos added a commit that referenced this pull request Jul 2, 2026
…review)

Right- or middle-clicking the A–Z rail (or a secondary multi-touch
pointer) no longer triggers a seek; only the primary tap/drag scrubs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@byrongamatos
byrongamatos force-pushed the fix/v3-az-rail-pointer-scrub branch from 78fb9bb to ff54ae4 Compare July 2, 2026 11:53
ChrisBeWithYou and others added 2 commits July 2, 2026 13:59
Follow-up to #634. Three rail bugs reported on macOS + Windows (0.3.0,
2026-06-29 — =Scr4tch=, MajorMokoto):

- Taps often did nothing ("clicked O, nothing happened"). pointerdown
  calls setPointerCapture, after which the browser retargets the
  follow-up click to the rail container, so the click handler's
  closest('.v3-azrail-letter') resolved null and a plain tap (no
  pointermove) had no other path. Drive the jump from pointerdown
  itself; reduce the click handler to keyboard activation only
  (e.detail === 0, Enter/Space).

- A drag landed short of the release ("where you release isn't where
  you get sent"). Every letter crossed fired jumpToLetter with
  behavior:'smooth'; stacked smooth-scroll animations over the
  virtualized grid lagged and settled imprecisely. jumpToLetter now
  takes a smooth flag and scrolls instantly ('auto') while scrubbing,
  animating only discrete taps/keyboard jumps, so the grid tracks the
  finger and the release lands on the let-go letter.

- The rail was too small at 1440p and didn't scale. Letters were a
  fixed .62rem glued at right:2px (~13px-tall target). They now scale
  with the viewport (clamp(.72rem, 1.4vh, 1.05rem)), sit off the edge
  with taller/wider equal-width hit targets and a hover/active
  highlight so the scrub target is visible.

Keyboard arrow-nav and present-letter gating are unchanged. Tests:
tests/js/v3_az_rail.test.js gains pointerdown-seek, keyboard-only click
guard, and instant-vs-smooth assertions (809 JS tests; the 13
pre-existing unrelated failures are unchanged).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QbexxfTt8q2tAn436MqGWF
…review)

Right- or middle-clicking the A–Z rail (or a secondary multi-touch
pointer) no longer triggers a seek; only the primary tap/drag scrubs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@byrongamatos
byrongamatos force-pushed the fix/v3-az-rail-pointer-scrub branch from ff54ae4 to 056f9d5 Compare July 2, 2026 11:59
@byrongamatos
byrongamatos merged commit 15fabb6 into main Jul 2, 2026
0 of 3 checks passed
@byrongamatos
byrongamatos deleted the fix/v3-az-rail-pointer-scrub branch July 2, 2026 11:59
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.

2 participants