[Frontend/Fix]: Fix commit modal crashes#3977
Merged
Conversation
…ode issues - Add `computeOnMountOnly` prop to EntityCommitContent diff viewer - Set TextNode mode to "token" for all diff content nodes to prevent normalization - Track diff-built state per editor using WeakSet to survive Strict Mode double-mounts - Register no-op transforms for TextNode and CodeLineNode to absorb dirty nodes - Defer INITIAL_CONTENT_COMMAND dispatch to queueMicrotask to avoid nested updates - Mark diff as built before appending to root
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
mmabrouk
approved these changes
Mar 12, 2026
Contributor
Railway Preview Environment
Updated at 2026-03-13T12:47:15.900Z |
bekossy
approved these changes
Mar 12, 2026
Skip inline diff computation for lines exceeding the truncation threshold (200 chars). Long lines (e.g. serialized prompts ~4700 chars) produced massive Lexical TextNodes that froze the DOM reconciler. Also disable HistoryPlugin for read-only diff views. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…egistration
Remove INITIAL_CONTENT_COMMAND dependency from diffHighlight extension.
Build diff content synchronously during registerDiffHighlightBehavior()
using { discrete: true } to force immediate commit. Truncate large
changed segments (>600 chars) to prevent DOM freeze. Remove root
listener and command payload fields (originalContent, modifiedContent,
isDiffRequest).
Defer DiffView rendering until after first paint using requestAnimationFrame to prevent Lexical editor creation from blocking the commit modal shell. Remove word-level inline diff computation—keep only character-level prefix/suffix matching for mostly-similar lines. Simplify truncation to in-place segment shortening instead of adding truncation indicator nodes, avoiding DOM reconciliation freeze. Increase modified line background
Remove Suspense wrapper and lazy import for DiffView component. Import DiffView directly to eliminate loading skeleton and simplify rendering path. Comment out diffReady state check and fallback skeleton UI.
Remove lazy and Suspense imports that are no longer needed after removing lazy loading for DiffView component.
Remove Skeleton import from antd that is no longer needed after removing loading skeleton UI. Also rename unused diffReady state variable to _.
bekossy
approved these changes
Mar 13, 2026
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.
Summary
computeOnMountOnlyprop to EntityCommitContent diff viewer