Site Editor: Fix canvas mode sync with URL#52996
Conversation
|
Size Change: +325 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
|
👋🏻 Do you think bugfix should be included in the next/final RC for 6.3? If so, add the RC label so we don't miss it. Thanks! 🙇🏻 |
aaronrobertshaw
left a comment
There was a problem hiding this comment.
Thanks for the fix @Mamaduka 👍
From my understanding of the issue, I believe this PR does fix the root problem.
It looks like there's a typo in the test instructions though and the supplied URL should be canvas=view. As supplied that URL loads the canvas in edit mode. Switching it to canvas=view does load in view mode as advertised.
Using the adjusted URL I can replicate the original issue on trunk.
packages/edit-site/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js
Outdated
Show resolved
Hide resolved
|
Flaky tests detected in 8a3b56e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5677186810
|
|
I just cherry-picked this PR to the update/packages-wp-6-3-RC3 branch to get it included in the next release: c031386 |
* Patterns: Enable focus mode editing (#52427) * PreventDefault when isComposing is true. apply patch from t-hamano. (#52844) see: #52821 (comment) * List View: Ensure onDrop does not fire if there is no target (#52959) * I18N: Add missing Gettext wrapper on strings in Edit Post overview sidebar (#52971) * I18N: Add missing gettext wrapper * Add context to disambiguate 'Outline' that is commonly used on borders. * Footnotes: disable based on post type (#52934) * Footnotes: disable based on post type * Address feedback * Fix typo * Format: disable if block is not registered * Lock usesContext api * Use Symbol instead of Math.random * Patterns Browse Screen: Fix back button when switching between categories (#52964) * Patterns: Allow orphaned template parts to appear in general category (#52961) * Spacing presets: fix bug with select control adding undefined preset values (#53005) * Site Editor: Fix canvas mode sync with URL (#52996) * Check if spacing tool is defined before displaying controls. (#53008) * Check if spacing tool is defined before displaying controls. * Don't show sides if spacing type false * Improve consistency of the Post editor and Site editor Document actions (#52246) * Remove redundant shortcut button. * Fix focus and hover style and improve consistency. * Rename post document-title and improve CSS consistency. * Site Editor: Fix the typo in the title label map (#53071) * Fix patterns search crash: check for existence of defaultView before attempting to get styles (#52956) * backport paging bug fixes (#53091) --------- Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com> Co-authored-by: Hiroshi Urabe <mail@torounit.com> Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Co-authored-by: Pedro Mendonça <ped.gaspar@gmail.com> Co-authored-by: Ella <4710635+ellatrix@users.noreply.github.com> Co-authored-by: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Co-authored-by: Glen Davies <glendaviesnz@users.noreply.github.com> Co-authored-by: tellthemachines <tellthemachines@users.noreply.github.com> Co-authored-by: Andrea Fercia <a.fercia@gmail.com>
|
Where do we set "canvas" to "view" in query arguments. For me that just mean dropping the canvas argument. I guess it's harmless to ship this fix but I'd have just removed the argument from the url. |
|
@youknowriad, that's what I did in #52891. This solves a different issue where canvas mode got stuck on |
What?
PR fixes the URL synchronization side-effect in the
useSyncCanvasModeWithURLhook, where canvas mode wasn't synced if it was set toviewin query arguments.Why?
Without this sync, canvas stays in
initmode and stops rendering the editor.gutenberg/packages/edit-site/src/components/layout/index.js
Lines 158 to 163 in 7eddee3
Testing Instructions
Screenshots or screencast
CleanShot.2023-07-24.at.17.49.28.mp4