Distraction Free Keyboard Shortcut: Fix notices in site editor#52867
Merged
andrewserong merged 1 commit intotrunkfrom Jul 24, 2023
Merged
Distraction Free Keyboard Shortcut: Fix notices in site editor#52867andrewserong merged 1 commit intotrunkfrom
andrewserong merged 1 commit intotrunkfrom
Conversation
|
Size Change: -5 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in eb84483. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5641278847
|
ramonjd
approved these changes
Jul 24, 2023
Member
ramonjd
left a comment
There was a problem hiding this comment.
Nice find. Goes to show it pays to ditch the mouse now and then 😄
Can confirm that on trunk I see the following:
Uncaught TypeError: isFeatureActive is not a function
On this branch:
2023-07-24.16.29.28.mp4
Contributor
Author
|
Thanks for the quick review! 🙇 |
Contributor
|
I just cherry-picked this PR to the update/further-bugfixes-rc2 branch to get it included in the next release: 218ce78 |
ramonjd
added a commit
that referenced
this pull request
Jul 25, 2023
* Fix image block v6 deprecation (#52822) * Remove incorrect comment * Add missing attribtes and supports * Add integration tests for the deprecation * Fix incorrect import * Fix fixtures * Image: Use the correct method for caption class in recent deprecation (#52853) * Distraction Free: Fix notices in site editor (#52867) * Distraction Free: Add missing command in site editor (#52868) * Site Editor: Fix the template parts link on the list page (#52891) * Return focus more from focus return hook (#52710) * Disambiguate "Import" button string. (#52907) * Disambiguate "Import" button string. * Add _x to import --------- Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com> * My patterns page: Increase color contrast for the toggle group (#52678) * Update style.scss * Update style.scss * Check if object exists before accessing its properties. (#52870) * Check if object exists before accessing its properties. * Name anonymous functions * Update names * Sidebar: Restore Back buton 'go to parent' functionality (#52910) * Global styles revisions: display text if no revisions are found (#52865) * If somehow a user lands on the revisions panel when there are no revisions, show some helpful text rather than a loading spinner. Also, add an E2E test! * Updated unit tests to reflect resolver logic changes * Use existing string * Only open edit view when testing the revisions panel itself * ResizableFrame: Account for window resizing (#52697) * ResizableFrame: Account for window resizing * Don't memoize --------- Co-authored-by: Robert Anderson <robert@noisysocks.com> * Distraction Free: Fix conflict with showListViewByDefault preference (#52914) * Backporting changes from WordPress/wordpress-develop#4891 * Site Editor: Open template parts in view canvas view mode (#52916) --------- Co-authored-by: Alex Lende <alex+github.com@lende.xyz> Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com> Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Co-authored-by: Mitchell Austin <mr.fye@oneandthesame.net> Co-authored-by: Jb Audras <audrasjb@gmail.com> Co-authored-by: Carolina Nymark <myazalea@hotmail.com> Co-authored-by: Robert Anderson <robert@noisysocks.com> Co-authored-by: Ramon <ramonjd@users.noreply.github.com> Co-authored-by: Lena Morita <lena@jaguchi.com> Co-authored-by: ramon <ramonjd@gmail.com>
Contributor
|
Thank you! 🙏🏻 |
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?
Distraction Free mode was added to the site editor in #51173, so will be part of WP 6.3.
This PR fixes the display of notices when toggling Distraction Free mode via the keyboard shortcut. Currently they are not displayed in the site editor when toggling via keyboard, but they are within the post editor.
Why?
Prior to this PR, the notices weren't displaying due to
isFeatureActiveattempting to be accessed fromdispatch, resulting inTypeError: isFeatureActive is not a function.How?
isFeatureActiveand replace withgetfrom the preferences store (we could accessisFeatureActivefrom the edit-site store viauseSelect, but the selector has been deprecated, so best to usegetfrom the preferences store instead).toggleFeaturefrom the edit-site store withtogglefrom the preferences store (toggleFeatureis deprecated so it was throwing a warning)Testing Instructions
CMD+SHIFT+\on a Mac)Screenshots or screencast
The error and warning: