🐛 fix(chat-input): memoize mentionOption/slashOption to prevent freeze on paste#13551
Merged
🐛 fix(chat-input): memoize mentionOption/slashOption to prevent freeze on paste#13551
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
|
@canisminor1990 - This is an editor/chat-input bug fix. Please take a look. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## canary #13551 +/- ##
===========================================
- Coverage 86.00% 66.63% -19.37%
===========================================
Files 609 1996 +1387
Lines 49045 165640 +116595
Branches 7596 16076 +8480
===========================================
+ Hits 42179 110367 +68188
- Misses 6742 55149 +48407
Partials 124 124
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…age freeze on paste Stabilize mentionOption and slashOption references with useMemo/useCallback to break the infinite re-render loop that occurs when pasting text triggers autocomplete. Fixes LOBE-6684 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… prevent empty lines Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
26abda1 to
9fdf3d4
Compare
…t interrupting Chinese input Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Fix: Memoize
mentionOptionandslashOptionprops inInputEditorto stabilize object references across re-rendersRoot cause: Inline objects and arrow functions caused new references every render →
Editor.memoSlashrecomputed →ReactSlashPluginre-registered the slash plugin → update listener fired →triggerOpencalled again → infinite loop when paste triggers autocompleteChanges: Extract
markdownWriterandonSelectintouseCallback, wrap both option objects withuseMemoFixes LOBE-6684
fix LOBE-6693
Test plan
@or/into chat input — page should not freeze@then search)/at line start)🤖 Generated with Claude Code