Repository navigation
Conversation
|
@shruti-tg is attempting to deploy a commit to the Excalidraw Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
PR up: #76 Screen.Recording.2026-05-22.at.6.24.41.PM.mov |
This branch has not been deployed
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
Adds a Replay button to the inline toolbar that re-triggers the streaming SVG animation after the model has finished rendering. The button cycles through three states:
Reverts to Replay when the animation completes.
Motivation
The streaming draw-on animation is one of the most engaging parts of the widget, especially for educational diagrams (algorithm traces, step-by-step explanations). Today it only plays once — when the model first renders. Letting the user replay it makes the diagram a re-watchable artifact instead of a one-shot reveal.
Implementation
setToolInput/setInputIsFinalflow the MCP host uses, walking through the saved element array withsetTimeoutand feeding progressively larger slices as partials, then a final pass with the original JSON.replayKeycounter is passed toDiagramView; bumping it clearslatestRef, the SVG wrapper'sinnerHTML, and the count — so new nodes get the CSS fade-in/stroke draw-on animations instead of being preserved by morphdom.replayStateRef(elements, index, timer) so pause canclearTimeoutthe pending tick and resume can re-schedule it without stale closures or re-renders per tick..main.replayingmodifier so it stays pinned atopacity: 1during the animation — otherwise the Pause button would disappear when the user moves the mouse off to watch.userEditsexist (don't clobber edits persisted from a fullscreen session) and when no final input has been received yet.Test plan
npm run dev:ui— load the Binary Search sample, wait for initial render, click Replay, then Pause mid-stream, then Play to resumenpm run serve+ connect from Claude — render a diagram, click Replay, verify the animation replays from scratch with hand-drawn fade-inisReplaying)