feat(cli): motion command — surface GSAP motion + 3D onion-skin --shot#1603
Open
miguel-heygen wants to merge 18 commits into
Open
feat(cli): motion command — surface GSAP motion + 3D onion-skin --shot#1603miguel-heygen wants to merge 18 commits into
miguel-heygen wants to merge 18 commits into
Conversation
…shot Read-then-edit-source tool for GSAP motion. Surfaces every tween's keyframes as data; --shot renders a true-3D onion-skin of the real element (samples the live timeline at N steps; rotation/scale/opacity/colour/3D, not just x/y) for visual self-verify. Multi-stroke pen-up traces for holed/detached shapes. Framing: --layout strip (filmstrip), --from/--to (time window), --no-fit, --angle (orbit camera). Pure geometry+SVG in keyframesShotLayout.ts (unit-tested). Ships the hyperframes-keyframes skill. Depends only on what's already in main.
One viewpoint hides depth — a flip reads as a static stack head-on, a tumble looks flat. Mandate ≥3 angles (front+top+side/iso) for any 3D motion, and --layout strip for in-place/overlapping motion.
…t-write-wins) When a brief has channels independent in phase or rate (orbit + axial spin, path + flap, bounce + roll), layer them across nested elements (parent=trajectory, child=secondary) instead of cramming one tween; --shot --selector the leaf shows the composition.
A nested child's rendered motion is composed with its animated ancestors, but the per-element text/JSON surface showed only the child's own tween — hiding a parent's path (a judge/agent reading text would miss it). Now each tween is annotated with its animated DOM ancestors and their motion EXTENT (per-property min..max, so a closed loop still reveals its travel).
…aligned squash vs spin, heading=tangent, per-channel check) + composed-surface note
2 tasks
…nel & motion-trail patterns
…eadless blank-render gotchas (perspective+SVG, attr-keyframes)
… absent from the reference
| let projectName: string; | ||
| let projectDir: string | undefined; | ||
| if (raw && raw.endsWith(".html") && existsSync(raw) && statSync(raw).isFile()) { | ||
| comps = [surfaceComposition(readFileSync(raw, "utf-8"), basename(raw), raw)]; |
Internal eval loop guidance, renderable timeline contract, honest diagnostics, explicit pen-up, geometry-morph rule, cursor causality.
- onUpdate/modifiers ARE seek-safe in HyperFrames (engine seeks with totalTime(t,false)); corrects the common 'onUpdate freezes on seek' folklore. Verified across core adapter, studio, runtime IIFE. - morph: trust the emitted geometry string (degenerate Beziers, clip-path+border-radius, corner>=edge magnitude). - 3D: no face-flat landing; backface-visibility on every rotating ancestor; don't compound perspective. - flythrough: drive size by translateZ, cap z<P (projection inverts).
- seek-safety corollaries: drive followers from tl.time() not construction order; own t=0 explicitly (fromTo immediate-renders its from-state at build); animate values through a real channel. - 3D: grouping properties (opacity<1/filter/clip-path/mask/overflow) flatten preserve-3d and break z-sort; orbit from one phase angle. V2: skill 87 vs baseline 74, skill won 10/10 (V1 was 6/10); both V1 losses (p2,p4) flipped to wins.
Make 'npx hyperframes motion' see motion it was blind to: - fold const expressions in keyframes (MemberExpression, array index, whitelisted Math.*) instead of emitting __raw: - seed gsap.set()/tl.set() pre-states as the following tween's start keyframe (fixes grow/fold/fade-from reading as flat X->X no-ops) - resolve addLabel() + label-relative positions to absolute times - bind toArray()/slice collection aliases to their selector - label proxy-onUpdate and empty dwell tweens instead of __unresolved__
window.__timelines = { 'comp-1': tl } now recognized as valid
registration and its keys extracted, matching the keyed-assignment form.
The render path seeks window.__timelines[root data-composition-id]; a missing/mismatched id silently rendered frozen at t=0 while --shot (which seeks __timelines directly) looked fine. Surface a diagnostic + console.warn at render-ready instead of failing silently.
A selector matching a static .clip wrapper no longer errors with 'no animated element to sample'; it samples the root's animated descendants. Unblocks the documented '--selector .clip --angle iso' 3D verify command.
- render binds the timeline by the root's data-composition-id; register window.__timelines under that exact key or the render freezes at t=0 (while --shot still looks fine). The #1 'looks fine, ships broken' trap. - --shot shows an element's motion, not painted structure; use 'snapshot --at' for masked type / metaballs / 3D / layers.
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.
Problem
The PR originally introduced the motion-surfacing tool as
hyperframes keyframes, but the intended product/skill name is nowmotion. Leaving the command, implementation files, and skill package namedkeyframesmakes the public CLI surface feel narrower than what the tool actually does: inspect, debug, and improve rendered motion.What this fixes
npx hyperframes motion.keyframes*.tstomotion*.tswhile preserving the keyframe data model inside the command where that term is still accurate.hyperframes-keyframestohyperframes-motion.Root cause
The original command name described one implementation detail: surfacing GSAP keyframes. The tool has grown into a broader motion-debugging loop with onion-skin screenshots, true-3D sampling, composed ancestor motion, multi-stroke traces, and motion-design critique. The source layout and skill name needed to match that broader behavior.
Verification
Local checks
git diff --cached --checkbunx oxfmt --check packages/cli/src/cli.ts packages/cli/src/commands/motion.ts packages/cli/src/commands/motion.test.ts packages/cli/src/commands/motionShot.ts packages/cli/src/commands/motionShotLayout.ts packages/cli/src/commands/motionShotLayout.test.tsbunx oxlint packages/cli/src/cli.ts packages/cli/src/commands/motion.ts packages/cli/src/commands/motion.test.ts packages/cli/src/commands/motionShot.ts packages/cli/src/commands/motionShotLayout.ts packages/cli/src/commands/motionShotLayout.test.tsbun run lint:skillsbun run test -- src/commands/motion.test.ts src/commands/motionShotLayout.test.tsfrompackages/cli(22tests passed)bun run typecheckfrompackages/clibun packages/cli/src/cli.ts motion --helpPre-commit also ran lint, format, fallow, and typecheck successfully for the committed changes.
Browser verification
No browser app flow is affected by this CLI/skill rename. The user-visible smoke path is the CLI help output for
hyperframes motion, verified locally.Notes
feat/keyframes-cli; the PR title/body and code now use themotionproduct name.package.json,bun.lock, andshots/changes were left unstaged and were not pushed.