Skip to content
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

fix(structure): use correct loading messages while resolving panes #6093

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented Mar 20, 2024

Description

While the structure panes are resolving (when using async resolvers), we show one or more loading messages. It starts with a "Loading..." message, shown after X ms. Later, after X seconds, it is supposed to show a "Still loading..." followed by a "Check if there's something wrong with your structure definition" kind of thing.

This code path has been broken for a while now, it seems:

  1. The i18n changes had an error, so we're actually showing the resource key instead of the translated message for the first loading message
  2. After v3, we checked for a subscribe method on what hopefully is an observable of loading messages, but we returned if that was the case, when we actually wanted the opposite. If what was passed did not have a subscribe method, we would actually have crashed here.

This PR fixes both of these cases.

What to review

  • Loading pane shows correct messages (use the workshop story to more easily see it, or create a child structure resolver that waits for 10+s before returning the child node

Testing

I've added a workshop story for this. Ideally I'd also add automated tests, but seems like we're missing some established tests in the structure codebase that I can base them off of.

Notes for release

  • Fixed incorrect loading message shown while a pane is resolving in the structure tool

@rexxars rexxars requested a review from a team as a code owner March 20, 2024 16:31
@rexxars rexxars requested review from binoy14 and removed request for a team March 20, 2024 16:31
Copy link

vercel bot commented Mar 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Mar 20, 2024 4:31pm
test-studio ✅ Ready (Inspect) Visit Preview Mar 20, 2024 4:31pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Mar 20, 2024 4:31pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

Component Testing Report Updated Mar 20, 2024 4:40 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 32s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 12s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 32s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 59s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 2s 18 0 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 20s 9 0 0

Copy link
Contributor

@binoy14 binoy14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to me, thanks!

@binoy14 binoy14 added this pull request to the merge queue Mar 20, 2024
Merged via the queue into next with commit d784f82 Mar 20, 2024
34 of 35 checks passed
@binoy14 binoy14 deleted the fix/structure-loading-pane-messages branch March 20, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants