Repository navigation
fix(visimer): restore the rendered label when an edit is cancelled (#6509) - #45
Merged
Merged
Conversation
…6509) * fix(visimer): restore the rendered label when an in-place edit is cancelled Escape on an in-place label edit wrote the raw label text from the diagram source back into the label with innerHTML. That text never passed through mermaid's sanitizer. The canvas now saves the label nodes that mermaid rendered when the edit opens and puts them back on Escape. If a render replaced the label during the edit, the canvas also repaints it from source. The reinject after a mid-edit render now moves the typed nodes into the new label instead of re-parsing them as HTML. * refactor(visimer): repaint a swapped label with a direct render call The Escape path set renderHeldByEdit only to reach the held-render block below it. Call scheduleRender directly instead. scheduleRender restarts one debounce timer, so a second call from the held-render block is harmless. * refactor(visimer): drop prose comments and pin the label swap in the repaint test The new and rewritten prose comments in view.ts and inplace.test.ts are outside the default comment allowlist. The Escape rule stays as a single STOP marker. The comments that described the removed innerHTML reinject are deleted with it. The repaint test now checks that the in-flight render replaced the label, and that the new label is still editable, before it sends Escape. Without that check, a late swap would let the test pass without reaching the repaint branch. GitOrigin-RevId: ca5cd6619147dd31d292ad6bd3282c5125156669
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.
Copybara-translated 1 Inkeep OSS change. Rebase-merge this PR so the prepared commit lands directly on public main.