mirror of
https://github.com/penpot/penpot.git
synced 2026-11-20 09:00:49 +00:00
On the WebGL renderer, the workspace resizes auto-grow texts whose stored size no longer matches their WASM layout. This runs when a page opens and when fonts finish loading. These resizes are not user actions, but each one recorded an undo step. So the first Ctrl+Z after opening a page undid the resize instead of the user's last edit, and the copy went back to the wrong size. The listener for the stale-text event now asks for the resize with :save-undo? false. The flag passes through the resize debounce to the commit, which hands it to apply-wasm-modifiers, so the shape update records no undo step. Resizes are batched in a debounce window. A batch skips the undo step only when every request in it asked for that. A user resize that lands in the same window keeps its undo entry. Batch options are now merged for every request, including those without options, so this check works. Tests: frontend-tests.data.workspace-heal-undo-test covers a heal resize that commits without an undo step, a resize without the flag that still records one, a mixed batch that keeps the undo step in either order, and a batch of heals that skips it. Relates to #12721 Relates to #13065 AI-assisted-by: claude-opus-5-5