-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify the Editor Mode Switcher, and enable it for template editing in the post editor #57868
Closed
talldan
wants to merge
5
commits into
trunk
from
add/code-editor-mode-to-template-editing-in-post-editor
Closed
Unify the Editor Mode Switcher, and enable it for template editing in the post editor #57868
talldan
wants to merge
5
commits into
trunk
from
add/code-editor-mode-to-template-editing-in-post-editor
Conversation
This file contains 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
talldan
added
[Type] Enhancement
A suggestion for improvement.
[Package] Editor
/packages/editor
labels
Jan 16, 2024
Size Change: -77 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
talldan
force-pushed
the
add/code-editor-mode-to-template-editing-in-post-editor
branch
from
January 30, 2024 08:52
14dd426
to
29c8a6e
Compare
talldan
deleted the
add/code-editor-mode-to-template-editing-in-post-editor
branch
July 1, 2024 03:26
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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?
Related to https://github.com/WordPress/gutenberg/pull/57700/files#r1446996419
One of the changes I made in #57700 was to enable code editor mode when editing a template in the post editor.
As part of that I thought I'd tidy up some of the code, unifying it so that there's one mode switcher component.
On the way I noticed the
switchEditorMode
action works differently in the site editor compared to the post editor, and I'm not sure why. There is currently an issue in this PR where switch to the code editor causes a focus loss, so that may be why. It'll need to be fixed before this PR can be merged.Why?
There was both duplication and inconsistency before.
How?
ModeSwitcher
component to the editor package (as a private API).setEditorMode
action to the editor store that carries out a few steps (handles distraction free mode, makes a spoken announcement, clears the selected block).Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast