-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Prepublish: suggest uploading external images #46014
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Size Change: +825 B (0%) Total Size: 1.42 MB
ℹ️ View Unchanged
|
packages/editor/src/components/post-publish-panel/maybe-upload-media.js
Outdated
Show resolved
Hide resolved
2a6b3a3
to
ab2e2f0
Compare
packages/editor/src/components/post-publish-panel/maybe-upload-media.js
Outdated
Show resolved
Hide resolved
Nice one! Haven't yet had a chance to try this: what happens if you press "Publish" before you press "Upload all"? Should there be some warning or should it happen automatically? Like, could it be a checkbox: "upload all images" which then gets batched and part of the publish flow? |
They remain external images?
Why should there be a warning?
Not sure I understand what you mean 😅 |
Just thinking through the flow here, and it seems such a nice feature that it might be easy to overlook if a) it isn't given attention, or b) it's automatic. In the case of the latter, I mean there could be a checkbox: "Upload external images". You'd check it (or it would be checked by default), and when you press publish, it first uploads all external images and then publishes. The button would be candy striped for a bit longer, but it could be an integrated part of the flow. Mainly a thought for now. |
What happens if there are many external images, and you click Publish before the upload process is complete? Should the loading spinner overlay the entire panel to prevent this? Or perhaps the upload process takes place in the background, kind of like Joen suggested. |
@@ -6,7 +6,7 @@ | |||
// Ensure the post-publish panel accounts for the header and footer height. | |||
min-height: calc(100% - #{ $header-height + 84px }); | |||
|
|||
.components-spinner { | |||
> .components-spinner { |
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.
This seems quite specific here and this component is public API. Should we instead style your new Spinner instead? 🤔
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.
So this is styling another spinner in the same pannel and we want the new spinner to have no extra styling. Changed it here so this extra CSS only affects the existing spinner.
packages/editor/src/components/post-publish-panel/maybe-upload-media.js
Outdated
Show resolved
Hide resolved
cf704f9
to
900ccc8
Compare
Flaky tests detected in 245fcd082308a2f761eb0ed6957a416680db03b4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5343957310
|
Co-authored-by: Timothy Jacobs <timothy@ironbounddesigns.com>
245fcd0
to
00df9ec
Compare
Thanks for picking this one up again and not letting it fall through the cracks! |
Is this working with Google Docs images? I get this errors:
|
It looks similar to #63956. When there's a CORS policy error, the editor cannot fetch and upload an image. I think we need to improve the error handling and user feedback here. Otherwise, the feature seems to be not working. |
Also experiencing this : |
What?
Adds a prepublish panel suggesting to upload external images.
I'm not great at making a good UI, so feel free to tweak. :)
As for the technical bit: I think ideally we need a slot where block types can hook in and add custom logic, but this is a good start.
Why?
Make it more discoverable that you can upload them.
How?
Testing Instructions
Go to the demo content and publish.
Screenshots or screencast