Skip to content

feat: living vector marks (path paint, organic body, eyes, decorative stroke) - #33

Closed
professorpalmer wants to merge 3 commits into
remorses:mainfrom
professorpalmer:feature/living-vector-marks
Closed

feat: living vector marks (path paint, organic body, eyes, decorative stroke)#33
professorpalmer wants to merge 3 commits into
remorses:mainfrom
professorpalmer:feature/living-vector-marks

Conversation

@professorpalmer

@professorpalmer professorpalmer commented Aug 31, 2026

Copy link
Copy Markdown

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.

  • Native <canvas> custom element (packages/native/src/custom_elements/canvas.rs) paints JS path commands (move / line / curve / close) via gpui::PathBuilder and window.paint_path every frame.
  • React: Canvas, VectorPath, OrganicBody, VectorEyes, DecorativeStroke.
  • Loops (breathe / blink / wiggle) use GPUI request_animation_frame in Rust, not React setInterval.
  • Spring motion: host integrator in packages/native/src/motion.rs (stiffness/damping/mass/velocity; retarget keeps velocity) and JS stepSpring / GELATIN {28, 8, 1.25} on the frame loop. motion.div type: "spring" pumps via onFrame.
  • Example: 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 <svg source> is a monochrome mask tinted by style.color (path fill in markup is not the GPU paint).
  • Do not rebuild SVG strings or spring a 4px box's left/top/width/height every tick (1px dither). Spring TARGETS; freeze chrome; blink inner height.
  • GELATIN is underdamped gel; overdamped ~13/14/1 for micro UI (eyes).
  • No scale channel in this PR (cannot validate without metal).

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)
  • Native test-support / metal CI: still no Metal/Xcode on the machine that would build the binary
  • bun --hot examples/marks.tsx visually: body breathes, eyes glance/blink, stroke wiggles

professorpalmer and others added 3 commits August 30, 2026 20:22
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.
@professorpalmer

Copy link
Copy Markdown
Author

Springs moved to #34. Living-marks / OrganicBody / VectorEyes withdrawn — we shipped SVG stamps instead.

@professorpalmer
professorpalmer deleted the feature/living-vector-marks branch August 31, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant