-
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
Provide loading UX when UI is dependent on an API request #6723
Comments
I have concerns over loaders flashing up, can we set this to be a longer time than 'no-zero' seconds? I say this as flashing loaders are worse than no loaders for visual issues. Loader wise @jasmussen for consistency regarding icons, can you suggest a loader for this please? My preference would be a simple '. . .' type loader. |
Seems like this could be cool. I.e. the loader could be there always for loading, but have a CSS transition to "fade in and show itself" after 1 or 2 seconds passed. Then for any situations where the loading was faster than that, it would never fade in, and provide an "optimistic loading" scenario.
I feel like this is one of the situations where we should use the spinner that core comes with, and then redesign that one day. Referring to this little fella: (sorry that's not animated, it was hard to screen cap, but it rotates) It's not the best spinner in the world, and it definitely deserves updating. But I feel like it should be the same across WordPress, i.e. "redesigned upstream" if need be. By the way I think we already wrapped this spinner in a component. |
That seems like the best of both worlds so yes.
Works for me. |
I am removing design tag as the loader has been decided for start to be the one use across WordPress. |
I'd avoid using spinners for this and instead build "loading" states into each component to reflect the final UI. Related: https://wpcalypso.wordpress.com/devdocs/docs/reactivity.md Designing the states in which various UI pieces can be is important and should not be replaced just with generic spinners. |
The thinking was to use the loaders as a base to be just like WP. If states can be used then absolutely we should. The only caution here is we may want to patch throughout WordPress on merge to do that if possible. A state where we have some as loaders and some as states could be less than great. |
True, optimizing for first paint and async population of a skeleton blueprint would look nicer, as it reserves the space needed for the elements. Though even then some parts may take a while. So whether the skeleton is animated or it has a loader on/under/next to it is isn't a super big difference, or no? Could a loader be a simple v1 to alleviate this on the short term? As a related example, we implemented loading spinners as placeholders for our analysis bullets to show you when it's still 'thinking'. (No gif but you get the point) |
Sidenote — killer work on the Yoast sidebar Tim! I noticed the panel titles are a larger font size than stock Gutenberg panel sizes — any reason for that? |
Thanks! Yes, that's the result of us needing to accomodate two subheading levels in the analysis section, so starting from an 'H1' that is 13px didn't leave much room to differentiate with size 😄 |
Just to be clear, I'm not trying to influence anything here — I'm only excited to see a plugin itilize the sidebar API so well ;) — I think it's a great experience. But why do you have to differentiate those sizes? |
Well, we have quite a bit of text in the analysis sections, divided into different areas, plus collapsible subheaders. If all of it was the same size it would be hard to parse what's what, even when using boldness or color. The help text in each of our sections, too, is the very smallest that we could make it for a11y compliance, because the body font of sidebar text is already quite small on modern resolutions. But hit me up on slack if you want to talk shop more, don't want to derail this issue ;) |
Thanks Tim, really appreciate it, and sorry for the slight derailment, it was just intriguing! |
I think this should be addressed. |
Moving into the |
Can we bring in the circular indicator here please: To be clear we'd be removing using the current loaders from buttons like publish as part of this and using this status indicator throughout. Publish buttons would:
Any place that needs a loader would use this circular indicator: https://material.io/design/components/progress-indicators.html#circular-progress-indicators. |
From an a11y perspective, UI controls should always communicate the available action, not the underlying state. Also, a button should always have text or, less preferably, at least an aria-label
This should be carefully implemented to avoid a focus loss. When using a keyboard, the button has focus. After activation, the button becomes disabled and thus is not focusable focus loss. I'd suggest to consider to noop the button instead of disabling it. |
For now, let's implement this loader just on the API request points. @danielbachhuber are you able to implement this to fit in with the API work? |
@kadamwhite is picking it up over the next couple of days. |
We are wrapping up 4.1 today and I don't see any PR referenced. I'm moving it to 4.2, feel free to move it back to 4.1 if you have something to review before we release 4.1 😃 |
@kadamwhite Are you still planning to work on this or do you want to remove your assignment? |
From #11524 (comment), another imprecise behavior to address: even though the request for terms failed, the Tag Post Setting appears like this: I would've expected the Tag Post Setting to better communicate it's incomplete / failed state. |
Moving to |
@danielbachhuber @jasmussen @youknowriad Does anyone have this on their radar? It's been inactive for 4 years, is it still relevant? Can I help moving this ticket forward or can it be closed? :) |
@tomdevisser It's still relevant: CleanShot.2023-03-13.at.17.49.57.mp4You're welcome to move the ticket forward, if you'd like. I imagine it's somewhat of a can of worms. |
A single approach would not fit every UI (Component) piece in the editors. While "popcorning" is bad for UX, so are the loading indicators, especially when displayed simultaneously. Editors can preload blocking resources to avoid both patterns, but it's a tricky balance. I think we can close this general issue and focus on individual enhancements like #16026. |
Let's close, we can always reopen when needed. |
Some parts of the Gutenberg UI won't display until an API request has completed. When the API request takes a non-zero amount of time, the end user can be confused as to why the UI isn't yet displaying.
For example, here's a GIF of a scenario where the Parent Page selection UI takes 4 seconds to load:
It would be helpful to have some form of visual cue to indicate that UI is meant to be there, but contingent on the result of an API request.
The text was updated successfully, but these errors were encountered: