{{ message }}
Repository navigation
fix: #5394 cancel image resize when the document rebuilds - #5721
Merged
Merged
Conversation
Jocs
force-pushed
the
fix/5394-image-resize-reload
branch
from
October 12, 2026 13:48
d956f51 to
42b7e2a
Compare
Contributor
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.

Closes #5394
Summary
Reloading a file from disk, or undoing across a reload, while an image resize handle is held rebuilds the document tree. The resize bar retains the detached image block and tries to write its width on mouseup, throwing
Cannot destructure property 'path' of 'this.parent' as it is null.Cancel the resize before replacing the block tree, clear the cached image references and mouse listeners when hiding the bar, and guard deferred rendering, positioning, movement and release against a detached image. Releasing after reload or undo now quietly cancels the resize; the new document is preserved and a subsequent resize still works.
The current develop branch also reloads clean documents with Auto Save off, so regression coverage includes both Auto Save settings as well as the Edit > Undo action.
Type of change
Test plan
Validation passed:
pnpm -C packages/muya test— 2470 tests passed.pnpm -C packages/desktop exec playwright test test/e2e/issue-5394-image-resize-reload.spec.ts test/e2e/external-reload-undo.spec.ts test/e2e/issue-3652-auto-reload.spec.ts— 7 tests passed.pnpm run build:unpackpnpm run typecheckpnpm -C packages/muya lint:typespnpm run lint— no errors; existing repository warnings.Notes for reviewers
Real Electron tests assert that an external reload or undo cancels the held resize, preserves the updated document, reports no renderer error, saves no stale width, and allows a fresh drag to commit a width.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.