Repository navigation
Restore Show Animation in instance details - #35
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f201310634
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (tl) tl.kill(); | ||
| document.querySelectorAll('[data-moving-dot]').forEach(dot => dot.remove()); |
There was a problem hiding this comment.
Revert active effects before restarting the replay
When Show Animation is clicked again before the previous effects have settled, tl.kill() only cancels animations and callbacks owned by this timeline. The callbacks in animateFlow, activateTask, and endAnimation launch independent gsap.to tweens, including a 10-second fill tween, and killing a partially progressed first-element tween does not restore its original transform. Those effects can therefore continue modifying the diagram during the new replay or leave the first node enlarged; track these tweens in the timeline/a GSAP context and revert or kill them before resetting the state.
Useful? React with 👍 / 👎.
| script(src="/vendor/gsap/gsap.min.js") | ||
| script(src="/vendor/gsap/MotionPathPlugin.min.js") | ||
| script(src="/javascripts/SVGHelper.js") |
There was a problem hiding this comment.
Version the changed SVGHelper asset
On deployments that replace an existing release, returning browsers can continue using the old /javascripts/SVGHelper.js: the public static mount in src/app.ts assigns a one-year max-age, while this head still references the helper through the same unversioned URL. Such clients load the new local GSAP files but retain the pre-fix helper, so the animation restoration may not reach them until cache expiry or a hard refresh; fingerprint or version the helper URL when shipping these changes.
Useful? React with 👍 / 👎.
Restore instance replay by loading GSAP and MotionPathPlugin once from a local dependency, creating a fresh paused timeline for each click, targeting the actual first BPMN element, and guarding missing diagram items.
Verification before merge:
npm run build, 27 client tests, 13 unit tests, andgit diff --checkpassed. Deployment needsnpm cifor the new GSAP dependency.Browser tests were added separately in follow-up PR #36 after this PR merged.