Repository navigation
fix(ui): draw the scrubber at its rendered width - #3015
Merged
Merged
Conversation
The scrubber drew into a fixed 600 (compact 400) unit viewBox stretched to its container, so bar numbers, tempo labels and the cursor knob were distorted on wide and narrow players, and the tick count stayed one per bar regardless of the space available. It now measures its width and draws in CSS pixels. Bar numbers and ticks step in powers of two chosen from the space a bar gets, so wide players label more bars and long songs on narrow players no longer collapse their ticks into a solid band. Labels show one-based bar numbers at the start of their bar, matching the rendered score, and stay inside the scrubber at both ends. Tempo labels flip to the left of a marker near the right edge and are dropped by their actual width when they collide. Closes #3010
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
AI-authored disclosure (
alphatab-ai-authored-v1)Portions of this content were authored by an AI agent. The agent has read
AGENTS.md and the human submitter accepts responsibility for
compliance with the rules in that document.
Issues
Fixes #3010
Proposed changes
The scrubber always drew into a fixed 600-unit viewBox (400 when compact), stretched to its container with
preserveAspectRatio="none". As a result:The issue's proposed patch measures the width and picks power-of-two steps. This PR builds on that and also handles label size, the edges of the scrubber and the tempo labels:
The scrubber's height (38 px, 22 px compact) and its props are unchanged, so the transport, the compact player and the website's landing player keep their layout.
Checked in the playground control demo at 3440, 1400, 900 and 760 px (the 760 px window triggers the wrapped full-row transport).
Checklist
AI authorship disclosure
(
alphatab-ai-authored-v1) is present at the top of this body, and I havepersonally reviewed every change and can explain each one
Further details
website/