feat(studio): the timeline toolbar, headers and playhead on the shared primitives - #3776
Draft
miguel-heygen wants to merge 3 commits into
Draft
feat(studio): the timeline toolbar, headers and playhead on the shared primitives#3776miguel-heygen wants to merge 3 commits into
miguel-heygen wants to merge 3 commits into
Conversation
One menu chrome and one popover chrome, on Base UI, wearing the theme tokens. Dismissal is plain Base UI with no capture-phase wrapper: its outside-press listeners are registered on document with capture set, so the canvas overlay's bubble-phase stopPropagation cannot starve them. Menu items carry an optional mono shortcut hint, a disabled state and a danger tone. ContextMenu opens at the pointer. Popover shares the surface, radius and open motion but owns no item semantics, so a text field inside it keeps its own keys. Also adds [role='menuitemradio'] to the playback-shortcut ignore list. The hand-rolled speed menu spelled its rows as buttons, which that list already matched; the shared radio item is a div with the same role, and nothing else in the list matched it, so an open speed menu would have leaked arrow keys and Space to the player.
…opover' into feat/studio-u11-timeline-player-sweep # Conflicts: # packages/studio/src/components/ui/index.ts
…d primitives Every button in the timeline toolbar becomes an IconButton or a Button, the zoom slider becomes the shared Slider, and the SnapToolbar's grid-spacing panel becomes a Popover. Four hand-written class recipes (flatBtn, flatIdle, flatActive, flatDisabled) and one hand-rolled mousedown-outside listener go with them. The playhead reads --color-playhead instead of the accent, so the playhead, a selected clip and an accented control are three colours again rather than one (R3, AE7). The group-member rail on a track header moves to the accent token at a Tailwind alpha. Two behaviour notes. The zoom readout printed the word "Fit" in fit mode directly beside the Fit button, two identical labels of which one did nothing; it is a percentage in both modes now. And the grid panel's outside press is Base UI's, which listens in the capture phase, so it now dismisses over the canvas overlay that used to swallow the press. Colour literals in the touched files drop from 20 to 2; ratchet total 470 to 452.
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.
Lands the first half of unit U11 (timeline toolbar, track headers, playhead token) of the Studio design-system foundation. Stacked on the Renders sweep (#3772) and merges the menu PR (#3625). Ratchet 470 to 452. Bundle +9.1 KB gzipped. The five timeline menus and the menuKeyboardNav deletion are the second half, in the next PR.
What
The timeline toolbar, the canvas snap toolbar and the track headers move onto the shared primitives, and the playhead moves onto its own colour token.
IconButton(or aButtonfor "Fit"), and the zoom slider is the sharedSlider. The four hand-written class recipes the toolbar carried (flatBtn,flatIdle,flatActive,flatDisabled) are gone.Popover, and its three canvas buttons areIconButtons. The hand-rolledmousedown-outside listener and its two refs are deleted; the panel's contents are unchanged.--color-playheadfor its line, head and glow instead of the accent. The group-member rail on a track header reads the accent token at a Tailwind alpha.This is the first half of the timeline sweep. The five timeline menus (clip, track gap, keyframe, automation, speed) and the
menuKeyboardNavdeletion follow in a second PR, so this one stays reviewable.Why
Two controls that do the same thing should not have two implementations, and the timeline had the densest concentration of hand-written ones left. The measurable half is the playhead: it was drawn in the accent, so a playhead crossing a selected clip crossing an accented control was one colour doing three jobs. Playhead and selection are reserved colours precisely so that cannot happen.
Two defects surfaced on the way and are fixed here rather than filed:
mousedownlistener ondocument. The canvas overlay it sits on stops propagation on its own pointer handlers, so a press on the canvas could not reach it. Base UI registers outside-press with capture, so the panel now dismisses over the overlay. Verified in a browser, not only in the unit test.How
IconButtonandButtonalready own idle, hover, press, focus and disabled. Each toolbar toggle contributes only its "on" look, as one named class string per kind: a held hover wash for the on/off switches, an accent tint for the two view controls.enabled:hover:text-accentso it merges against the ghost variant's ownenabled:hover:class rather than racing it on specificity.bordershorthands became longhands. A shorthand whose colour is avar()is a pending-substitution value that the CSSOM will not read back, so nothing could assert the playhead's or the rail's colour.color-mix()there parses in every browser and in none of the tests, because happy-dom rejects the whole declaration and silently keeps the previous value. Its token belongs to the ratchet-to-zero unit.Test plan
Not covered
menuKeyboardNavdeletion. Second PR.