Repository navigation
Conversation
…ng them Replace the `useNativeUndo` registry with automatic detection. A keystroke that changes a text field's value without changing the editor history means the field keeps its text locally, so undo and redo there are left to the browser. Fields whose typing edits the history keep the editor undo. Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URwSqkS4bYhMhnseFgi
🤖 PR meta 🤖📦 Bundle sizeSize Change: +284 B (0%) Total Size: 8.68 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. As a user I want to be able to add multiple close buttons so that users can close the overlay from different positions in
|
Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URwSqkS4bYhMhnseFgi
…field Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URwSqkS4bYhMhnseFgi
Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URwSqkS4bYhMhnseFgi
Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URwSqkS4bYhMhnseFgi
This branch has not been deployed
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.
What?
See #18755. Follow up to #80768.
Proof of concept: replace the opt-in
useNativeUndoregistry with automatic detection, so every text field whose text is not part of the editor history leaves Cmd+Z / Cmd+Shift+Z to the browser, without per-component registration.If this approach looks feasible, I'll add end-to-end tests.
Why?
Only fields registered through
useNativeUndokeep the browser's own undo. Many other local-state fields still have undo taken over by the editor history, which rewinds an unrelated change. Registering each of them does not scale.How?
After a keystroke changes a text field's value, check whether the editor history (
getReferenceByDistinctEdits) changed too. If not, the field is treated as local and undo is left to the browser.useNativeUndoand its four usages are removed.Testing Instructions
Use of AI Tools
Investigation, implementation and this description were written with Claude Code.