Skip to content

Clone scroll transform pin and time tracks - #56

Open
hongnoul wants to merge 1 commit into
mainfrom
feat/issue-46-scroll-tracks
Open

Clone scroll transform pin and time tracks#56
hongnoul wants to merge 1 commit into
mainfrom
feat/issue-46-scroll-tracks

Conversation

@hongnoul

@hongnoul hongnoul commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • extend scroll-effect capture to serialize non-text visual scrub tracks, sticky-safe pin tracks, and threshold-triggered time tracks
  • add direct replay runtime with support gating and honest report-only fallback for unsupported shapes
  • add deterministic fixture and behavioral script that drives the generated clone at scroll positions and validates visual style changes, pin stability, and time state flips

Closes #46

Validation

  • scripts/test-clone-scroll-tracks.sh
  • pgrep -af "python3 -m http.server.*hwatu-issue46-scroll-tracks" || true
  • cargo test -q
  • cargo clippy -q --all-targets --all-features

@hongnoul hongnoul left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review verdict: changes requested (comment-only self-review).

P1 – tracks are marked replayed while changed properties are dropped. direct_style_supported returns true when any supported field changes, but does not reject other changed fields. The included timed fixture changes color; the capture key records it and the generated transition names it, yet writeStyle never writes color. The report still says replayed, and the behavioral test checks only state/opacity/transform. Implement color/background/text-shadow replay or classify tracks with any unhandled changed field as report-only, then assert computed color in the fixture.

P1 – the matrix support gate accepts shapes the runtime cannot preserve. supported_matrix accepts every matrix(...)/matrix3d(...), while matrix() retains only sx/sy/tx/ty, discarding rotation, skew, and most 3D terms. It also uses p[i] || 1, turning a legitimate zero scale into 1. Restrict the gate to axis-aligned scale/translate matrices or interpolate all coefficients, and add rotation/skew/scale-zero tests.

Validation: CI is green; both new focused Rust tests passed independently. Those tests currently encode only the happy-path subset above.

@hongnoul hongnoul left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up findings from an independent pass:

P1 – new tracks can suppress the existing text-effect capture. The text-group loop still stops on if (effects.length >= 3), but effects is now pre-seeded by pin/visual/time tracks. Three of those cause the loop to capture zero scroll-coupled-text-style effects, a regression from the old cap of three text groups. Count text-style effects separately.

P1 – retagging can invalidate an earlier replay selector. The time-track loop assigns c.el.dataset.hwatuScrollEffect = effectIndex without excluding an element already tagged as a visual/pin track. The old serialized selector then matches nothing while the report still marks it replayed. Skip already-tagged elements or use independent per-kind attributes.

P2 – worst-case capture latency jumps by ~42 seconds. Up to 80 text candidates each incur a 520 ms sequential dwell, even when no time effect exists. Gate probes on evidence from the coarse sweep or substantially reduce/batch the candidate set.

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.

clone: pins, transform/clip-path scrubs, and scroll-triggered time-based timelines have no capture/replay path (scale.com bottom half)

1 participant