feat: living vector marks (path paint, organic body, eyes, decorative stroke) - #33
Closed
professorpalmer wants to merge 3 commits into
Closed
feat: living vector marks (path paint, organic body, eyes, decorative stroke)#33professorpalmer wants to merge 3 commits into
professorpalmer wants to merge 3 commits into
Conversation
Introduced GPUIX-native primitives for living vector marks: - A new `<canvas>` custom element in `packages/native/src/custom_elements/canvas.rs` that renders arbitrary JS path commands via `gpui::PathBuilder` every frame natively. - React components `VectorPath`, `OrganicBody`, `VectorEyes`, and `DecorativeStroke` that wrap `<canvas>` with semantic properties (squash, breathe, glance, blink, wiggle). - Rebuilt native animation frame triggers using GPUI's Rust frame loop (`window.request_animation_frame()`), allowing seamless transforms without React's overhead. - Added `examples/marks.tsx` for showcase and `packages/react/src/__tests__/marks.test.tsx` for tests. Co-authored-by: Cursor <cursoragent@cursor.com>
verbatimModuleSyntax rejected the MotionDivProps value import; tsc is green again.
Author
|
Springs moved to #34. Living-marks / OrganicBody / VectorEyes withdrawn — we shipped SVG stamps instead. |
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.
Summary
GPUIX-native primitives for living vector marks, plus a native spring integrator proven in Automaton tonight (living SVG stamps + GELATIN). Transparency already works; this is the next capability.
<canvas>custom element (packages/native/src/custom_elements/canvas.rs) paints JS path commands (move/line/curve/close) viagpui::PathBuilderandwindow.paint_pathevery frame.Canvas,VectorPath,OrganicBody,VectorEyes,DecorativeStroke.request_animation_framein Rust, not ReactsetInterval.packages/native/src/motion.rs(stiffness/damping/mass/velocity; retarget keeps velocity) and JSstepSpring/GELATIN {28, 8, 1.25}on the frame loop.motion.divtype: "spring"pumps viaonFrame.examples/marks.tsx. Tests:packages/react/src/__tests__/marks.test.tsx,packages/react/src/__tests__/motion-spring.test.ts.Automaton notes (shipped against this API)
<svg source>is a monochrome mask tinted bystyle.color(path fill in markup is not the GPU paint).Why
Apps like Automaton currently swap PNG pose frames. These primitives let a body squash, eyes glance/blink, and accent strokes wiggle on the GPU; springs give the gel without CSS tweens.
Test plan
bun run test marks(structural React tests)bun run test src/__tests__/motion-spring.test.ts(rest snap + GELATIN overshoot)test-support/ metal CI: still no Metal/Xcode on the machine that would build the binarybun --hot examples/marks.tsxvisually: body breathes, eyes glance/blink, stroke wiggles