Repository navigation
fix(canvas): keep the selection outline on an element that is still transitioning - #559
Closed
shreyanshkotak wants to merge 2 commits into
Closed
shreyanshkotak wants to merge 2 commits into
shreyanshkotak wants to merge 2 commits into
Conversation
…ransitioning The outline follows its element by asking the frame runtime for its box on every html update, and the runtime measured once. A prop change on an instance whose component has `transition: all` landed while the padding was still on its way, so the outline and size badge stayed at that in-between size until the element was picked again. The runtime now answers a locate straight away and, when finite transitions or animations are running or a font is loading, once more after they settle. Only the latest locate per request id answers again. Comment pins and hover outlines use the same locate, so they follow too. Fixes doop-design#558
Review follow-ups on the selection outline fix: - answer a locate again as each running transition or animation ends (at most once a frame), so a long animation elsewhere in the frame no longer holds the outline at its mid-transition size; skip zero-rate animations, whose finished promise never settles - keep a locate's turn only while it waits, so the map of request ids does not grow with every pin and pick - drop a late layer-hover reply for a row the pointer has left - the regression test also runs a spinner and a 10s animation beside the button, waits out the reset's own transition, and takes the file's timeout
[Medium impact] The PR appears safe to merge. SummaryThe PR refreshes element outlines after running transitions, finite animations, and loading fonts finish.
Deferred scope:
|
VTalleyrand
pushed a commit
to VTalleyrand/doop
that referenced
this pull request
Nov 20, 2026
…ks don't flicker (doop-design#559) * fix(canvas): let a root vector's stroke spill past its box, as in Figma A standalone shape is its own iframe, sized exactly to the frame, so a stroke wider than the path's padding was cut off at the box. The runtime now asks for a margin that holds its widest stroke (doop:bleed-want); FrameView grows the iframe by it on every side, stops clipping the surface, and the runtime insets its body once told (doop:bleed). The runtime keeps speaking in the frame's design px, translating only at its viewport APIs, and the three editor sites that measure the iframe element take the margin off. Drawn path svgs paint their own overflow. W/H stay the path's geometry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(canvas): pick and drag a sibling inside an entered standalone group In a standalone shape, every hit collapsed to the shape's root, so with a layer inside it picked, clicking a sibling kept the old pick through the click's 250ms probe and then landed on the whole group: picked, dropped, picked. The press also dragged the whole shell. Once a layer inside the standalone is picked, hits resolve at that level (as groupLevel does in a frame) and the press goes through the layer move, picking the sibling at once; a press on the root itself still drags the shell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(canvas): the bleed margin's wrapper takes no presses either Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(canvas): hold a miter join out to its own miter limit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit d14f97012f710aa7426752a8a3c4d873da792176)
Collaborator
|
I think the better option is to not have transitions when an element is being edited, I made a PR here: #564 Closing this for now. |
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.
Fixes #558
Why
When a prop change on a selected instance changes its size, and the component has
transition: all(as the Button kit does), the selection outline andW × Hbadge stayed at a size the element never settled at, until it was picked again.The outline follows its element by asking the frame runtime for the element's box on every html update, and the runtime measured once. That measurement landed while the padding was still transitioning.
What changes
doop:locatein the frame runtime (src/lib/frameRuntime.ts) still answers straight away, then answers again as each running transition or animation ends, or when a loading font is in (whenLayoutSettles):FrameView.tsxnow drops a late reply for a row the pointer has left, as the selection handler already did..context/TECHSTACK.mddescribes the behaviour.Not covered
Size changes that come from a linked stylesheet's web font or an unsized image loading after the update. The runtime already reports those loads (
doop:frame-updated), so a re-locate on that message would be a small follow-up.Tests
tests/elementResizeBrowser.test.ts: a button undertransition: all 400mschanges variant while selected, beside an endless spinner and a 10s animation, and the grips must reach the settled width. It fails onmain(stuck at 124 instead of 152).typecheck,lint,format:checkanddoc-lintpass. The full suite passes excepttests/serverListen.test.ts, which fails the same way on an untouchedmainon my machine.