Skip to content

Fit the sheet to the screen and light keys while held - #5

Merged
PaulJoshi merged 1 commit into
mainfrom
claude/sheet-fit-key-animation
Oct 3, 2026
Merged

PaulJoshi merged 1 commit into
mainfrom
claude/sheet-fit-key-animation

Conversation

@PaulJoshi

Copy link
Copy Markdown
Owner

Requested by Paul · project thread

Before: the practice sheet could show both a vertical and a horizontal scrollbar. The vertical one appeared after engraving and narrowed the view, so the score ran a few pixels off the side; small window resizes (under 30px) never re-engraved. On phones the whole practice screen was wider than the screen. The keys at the bottom only lit up very faintly (soft cloud) outside a take, and during a take a correct or wrong note flashed for 280 ms regardless of how long the key was held. Raw mic detections also flashed keys.

After: the sheet always fits the screen's width and never scrolls sideways; it still scrolls vertically (cursor follow, wheel, touch) but with no scrollbar. Keys light up for exactly as long as a MIDI, computer or on-screen key is held: a clear neutral fill (stone on white keys, mute on black keys) and a slight dip into the key bed, fading in at 120 ms and back out at 200 ms. During a take the held key turns green or red as the judge decides and stays that colour until released. Mic input no longer lights keys (judged green/red during a mic take is unchanged).

How: SheetView engraves through a renderFit helper that shrinks OSMD's zoom when the drawn SVG is wider than the view, and re-fits on any width change. .sheet-wrap is overflow-x: hidden with a hidden scrollbar, and .practice uses a single minmax(0, 1fr) column. The runtime now always presses non-mic keys in liveKeys (the judgeHighlights gate is gone), and liveKeys.press keeps a verdict the judge already gave and cancels its flash timer so the key holds until note-off. Key colours use design-system neutrals only, so blue/green/red keep their meanings.

Checks: npm run typecheck, npm test (106 passed), npm run e2e (10 passed, including a new test for sheet fit and held key states).

🤖 Generated with Claude Code

https://claude.ai/code/session_01RaxZypfT9qcos5K5Ydg2bc


Generated by Claude Code

The sheet music is engraved to the view's width (shrinking the zoom when a bar
is too wide) and re-fits on any width change, so it never scrolls sideways. Its
vertical scrollbar is hidden, which also stops the scrollbar from narrowing the
view after engraving. The practice grid is one screen-wide column.

Keys now light up for as long as a MIDI, computer or on-screen key is held, also
during a take, where the judge recolours the held key green or red. Pressed keys
get a clear neutral fill and dip slightly. Raw mic detections no longer flash keys.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RaxZypfT9qcos5K5Ydg2bc
@PaulJoshi PaulJoshi self-assigned this Oct 3, 2026
@vercel

vercel Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
open-keys Ready Ready Preview Oct 3, 2026 6:21am UTC

@PaulJoshi
PaulJoshi merged commit 506e2ef into main Oct 3, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — bd7c6403 Deployed Oct 3, 2026 by vercel[bot]
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