-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* frame resizer centered * Use a lerp function to modify the height of the frame. It should gradually reduce from original aspect ratio until reaching a 9 / 19.5 view. * Make the frame full screen when the user resizes it to the left. Reset the initial aspect ratio if the frame is resized slightly, and trigger full screen if the frame is resized far enough over the sidebar. * Ensure the frame grows only to the left when going above its size. * Disable user selection while resizing the frame. * Make it easier to grab the handle. * Switch to setTimeout and set a fixed resizeRatio. * Modify oversized calculation to reduce resizing bug. * Avoid timer * Temp working * Clean up CSS * More cleanup * Refactor lerpy parts * More cleanup * Rename `isFull` to `isFullWidth` * Improve maintainability * More cleanup * Match component classnames * Invert control for flex changes * Calculate fluid resize ratio * Prevent React re-render loop warning * Always show handle when resizing * Maintain resizing cursor when resizing * Improve code comments * Exclude `ListPage` from ResizableFrame * Use CSS var for accent color * Handle spinner gracefully * Lift loading state so resizing can be disabled * Change max width for less jankiness * Remove outdated padding animation * Clean up magic numbers * Update saveSiteEditorEntities() locators * Update StyleBook.open() locators * Quickfix: Wait until load spinner is gone * Revert to class-based save detection The `.getByRole()` way resolves a bit too early. --------- Co-authored-by: Matías Ventura <mv@matiasventura.com> Co-authored-by: Lena Morita <lena@jaguchi.com> Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com> Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
- Loading branch information
1 parent
064f731
commit c689d9f
Showing
11 changed files
with
461 additions
and
171 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { useEffect, useState } from '@wordpress/element'; | ||
import { useSelect } from '@wordpress/data'; | ||
import { store as coreStore } from '@wordpress/core-data'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import useEditedEntityRecord from '../use-edited-entity-record'; | ||
|
||
export function useIsSiteEditorLoading() { | ||
const { isLoaded: hasLoadedPost } = useEditedEntityRecord(); | ||
const [ loaded, setLoaded ] = useState( false ); | ||
const inLoadingPause = useSelect( | ||
( select ) => { | ||
const hasResolvingSelectors = | ||
select( coreStore ).hasResolvingSelectors(); | ||
return ! loaded && ! hasResolvingSelectors; | ||
}, | ||
[ loaded ] | ||
); | ||
|
||
useEffect( () => { | ||
if ( inLoadingPause ) { | ||
/* | ||
* We're using an arbitrary 1s timeout here to catch brief moments | ||
* without any resolving selectors that would result in displaying | ||
* brief flickers of loading state and loaded state. | ||
* | ||
* It's worth experimenting with different values, since this also | ||
* adds 1s of artificial delay after loading has finished. | ||
*/ | ||
const timeout = setTimeout( () => { | ||
setLoaded( true ); | ||
}, 1000 ); | ||
|
||
return () => { | ||
clearTimeout( timeout ); | ||
}; | ||
} | ||
}, [ inLoadingPause ] ); | ||
|
||
return ! loaded || ! hasLoadedPost; | ||
} |
Oops, something went wrong.
c689d9f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flaky tests detected in c689d9f.
Some 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.
🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5027631616
📝 Reported issues:
/test/e2e/specs/site-editor/template-revert.spec.js
/test/e2e/specs/site-editor/template-revert.spec.js
specs/editor/various/autosave.test.js