-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(studio): consolidate timeline editor callbacks #2786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
miguel-heygen
merged 25 commits into
main
from
codex/studio-timeline-b-editor-callbacks-v2
Jul 28, 2026
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
e4d7bde
feat(studio): add keyframe timeline state
miguel-heygen e34e529
fix(studio): keep gsapAnimations in sync with the keyframe cache
miguel-heygen acf6766
refactor(studio): one owner for clip-relative keyframe rows
miguel-heygen d05ecb1
fix(studio): scope the per-file keyframe-cache clear to its own keys
miguel-heygen 3c7400a
fix(studio): close the review findings in this PR instead of at the s…
miguel-heygen b386b55
fix(studio): clamp the timeline scrub to 0 instead of dropping it
miguel-heygen 521bba6
refactor(studio): resolve tween selector ids through the shared reader
miguel-heygen d518972
feat(studio): add variable timeline timing and layout
miguel-heygen 95213d7
refactor(studio): give resolveTimelineMove a row-based vertical axis
miguel-heygen 4c7703f
refactor(studio): drop the duplicated row-top docblock
miguel-heygen e36fb38
feat(studio): add timeline keyframe retiming interactions
miguel-heygen 706f537
fix(studio): let Escape cancel a keyframe retime and throttle its pre…
miguel-heygen 6e0118c
refactor(studio): guard the diamond connector's previous keyframe
miguel-heygen fed5e5b
feat(studio): add timeline property lanes
miguel-heygen 8bb31b3
feat(studio): add keyframe track headers
miguel-heygen c264cf2
fix(studio): stop lane-header clicks from reaching the track row
miguel-heygen 4ac57a5
refactor(studio): split the track header's lane math out of its JSX
miguel-heygen f3ab446
refactor(studio): name the non-keyframe header for what it is
miguel-heygen 555d7f7
refactor(studio): drop the dead expandedElement guard
miguel-heygen 2d1b905
feat(studio): consolidate timeline editor callbacks
miguel-heygen ba8df26
fix(studio): resolve keyframe fallbacks against the clicked element
miguel-heygen 3f93794
fix(studio): resolve lane-header removal against the clicked element
miguel-heygen 8f66b06
fix(studio): retime the dragged element's own keyframe
miguel-heygen a423c93
refactor(studio): read animation cache keys through their owner
miguel-heygen 9fc0011
fix(studio): give every keyframe callback one mutation frame
miguel-heygen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
68 changes: 68 additions & 0 deletions
68
packages/studio/src/components/editor/GsapAddAnimationControl.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import { ADD_METHODS, ADD_METHOD_LABELS, METHOD_TOOLTIPS } from "./gsapAnimationConstants"; | ||
|
|
||
| const STYLES = { | ||
| classic: { | ||
| method: | ||
| "rounded-lg border border-neutral-700 bg-neutral-900 px-2.5 py-1.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white", | ||
| cancel: "px-1.5 text-[11px] text-neutral-500 hover:text-neutral-300", | ||
| trigger: "text-[11px] font-medium text-neutral-400 transition-colors hover:text-neutral-200", | ||
| }, | ||
| flat: { | ||
| method: | ||
| "rounded-lg border border-panel-border-input bg-panel-input px-2.5 py-1.5 text-[11px] font-medium text-panel-text-2 transition-colors hover:border-panel-text-4 hover:text-panel-text-0", | ||
| cancel: "px-1.5 text-[11px] text-panel-text-3 hover:text-panel-text-1", | ||
| trigger: "text-[11px] font-medium text-panel-text-3 transition-colors hover:text-panel-text-1", | ||
| }, | ||
| }; | ||
|
|
||
| export function GsapAddAnimationControl({ | ||
| open, | ||
| setOpen, | ||
| onAddAnimation, | ||
| track, | ||
| variant, | ||
| }: { | ||
| open: boolean; | ||
| setOpen: (open: boolean) => void; | ||
| onAddAnimation: (method: "to" | "from" | "set" | "fromTo") => void; | ||
| track: (control: string, name: string) => void; | ||
| variant: keyof typeof STYLES; | ||
| }) { | ||
| const styles = STYLES[variant]; | ||
|
|
||
| return ( | ||
| <div className="relative pt-1"> | ||
| {open ? ( | ||
| <div className="flex gap-1.5"> | ||
| {ADD_METHODS.map((method) => ( | ||
| <button | ||
| key={method} | ||
| type="button" | ||
| title={METHOD_TOOLTIPS[method]} | ||
| onClick={() => { | ||
| track("button", `Add ${method} animation`); | ||
| onAddAnimation(method); | ||
| setOpen(false); | ||
| }} | ||
| className={styles.method} | ||
| > | ||
| {ADD_METHOD_LABELS[method] ?? method} | ||
| </button> | ||
| ))} | ||
| <button type="button" onClick={() => setOpen(false)} className={styles.cancel}> | ||
| Cancel | ||
| </button> | ||
| </div> | ||
| ) : ( | ||
| <button | ||
| type="button" | ||
| onClick={() => setOpen(true)} | ||
| className={styles.trigger} | ||
| title="Add a new animation effect to this element" | ||
| > | ||
| + Add effect | ||
| </button> | ||
| )} | ||
| </div> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.