Repository navigation
fix(studio): a sealed empty box drags on the press right after its select click - #8772
Merged
Merged
Conversation
Contributor
Edit accuracy: accurate 273 (base branch 271), smooth 67 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) |
jrusso1020
approved these changes
Nov 24, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Approving at cc137c23.
- The fix is the missing rule, nothing more.
canEditSealedTextInlinenow refuses a selection whosetextContentis empty or whitespace-only. That is the same rulecanEditElementTextInlineapplies to a live element ((element.textContent ?? "").trim().length > 0). So the press that follows a selecting click on an empty box drags it in both modes instead of opening a text edit there. - The sealed text is a fair stand-in for the live one.
- A sealed selection's
textContentiscurrent.text.trim() || null(previewSelection.ts), from the frame'srenderedTextOf. That walks every text node under the element and skips onlyscript/styletext. - The live check never opens on an element with such children anyway (
hasOnlyFormattingChildren), so the two modes agree on what counts as empty.
- A sealed selection's
- Only this gate changes.
canOpenTextInlineroutes sealed selections through it, and nothing else readscanEditSealedTextInline. - Fails without the fix: the body names
inlineTextEdit.sealed.test.ts› "opens no sealed text edit on a box with no text, as a regular preview opens none". It covers an empty box, a whitespace-only box, and a box with text that must still open, in both modes. The before/after captures show the same drag on the bench fixture.
Need: a sealed drag right after its selecting click moved and saved the wrong layer · Size: right (one line, plus tests) · Reuse: the same rule as the live check · Simpler: yes · Structure: fine
Risk: low. The sealed gate only gets stricter, and only for boxes with no text to edit.
— Rames
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 25, 2026
Merged
3 of 4 tasks
1 of 4 tasks
Merged
3 of 4 tasks
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.
What
On a sealed preview, pressing an empty box right after the click that selects it now drags the box, as it does on a regular preview. Before, that press opened a text edit on the empty box and the drag moved nothing.
Why
A click that selects a box and the press that starts its drag a moment later land within Studio's double-press window. That pair is a double press, which opens the pressed layer's text for editing, if the layer has text to edit.
canEditElementTextInlineneeds non-empty text, so an empty box opens nothing and the press drags.canEditSealedTextInlinenever looked at the text. The press opened a text edit on the empty box, and the drag was swallowed.On the edit-accuracy bench (
seqab-none-px-r0-nested-z100: drag A, then select and drag B, then A again, inside a nested composition), the sealed run on main never saved B. B tracked 248 px off the pointer, the third drag landed 10 s late, and undo grouping failed. A regular run passes. Studio's select and drag traces for the press on B show the text path taken sealed and not unsealed.Related work
Refs #7846 (Studio's preview sealed by default): this is one of the edit-accuracy cases that fail only sealed.
How
components/editor/domEditInlineText.ts:canEditSealedTextInlinealso needs the selection's text (textContent, which a sealed selection carries already trimmed from the frame's description) to be non-empty. This is the same rulecanEditElementTextInlineapplies to a live element. Whitespace-only text counts as empty in both modes.Test plan
opens no sealed text edit on a box with no text, as a regular preview opens noneinsrc/hooks/inlineTextEdit.sealed.test.tsfailed on main withexpected true to be false. It checks an empty box and a whitespace-only box in both modes, and that a box with text still opens.seqab-none-*case (6) and every text case (textedit,textselect, 4) accurate sealed and unsealed. A real double press on text still opens and saves it.#other) after its drag#target)translate: 322.815px 218.543pxtranslate: -179.967px 187.119pxin 5 runstranslate: 322.815px 218.543pxtranslate: -179.967px 187.119pxtranslate: 322.815px 218.543pxThe one sealed run on this branch that did not move B was the first on a freshly started dev server, before the select trace was on; the four traced runs after it all match the regular preview.
Before
Sealed, without this change: B (blue) stays where it was, held open for text editing, and its drag moved nothing.
After
Sealed, this branch: B is where the drag let it go, selected with its handles.