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

feat(sanity): refine error UI #7520

Merged
merged 6 commits into from
Sep 24, 2024
Merged

Conversation

juice49
Copy link
Contributor

@juice49 juice49 commented Sep 18, 2024

Description

This branch introduces UI refinements to the StudioErrorBoundary component. The aim is to make this error UI less intimidating for users.

  • Hides error stack in production builds (this remains in development builds).
  • Adds copy explaining that an error occurred.
  • Adds "Copy error details" action.
  • Subtle UI refinements.
    • Removes red tint.
    • Adds spacing.
    • Centres content.

Additionally, the "Copy error details" action has been added to the document list error UI.

Global error

Before
before-global
After (production build)
after-global-production
After (development build)
after-global-development

Document list error

Before
before-document-list
After
after-document-list

What to review

  • Is the new copy okay?
  • StudioErrorBoundary is rendered outside of LocaleProvider, and therefore the text cannot be internationalised. Is that okay?
    • For the same reason, ErrorActions (which is now used inside document lists), cannot be internationalised (the retry button in document lists was previously internationalised). Is that okay?

Testing

  • Added unit tests for error serialization.
  • Triggered global errors by disconnecting network, and by throwing error from custom Studio layout component.
  • Triggered document list errors by disconnecting network, and by configuring document list with invalid GROQ filter expression.

Notes for release

  • The global error UI has been refined so that it is clearer to users and less visually distressing.
  • The global error UI now only displays the stack trace in development builds.
  • A "Copy error details" action has been added to the global error UI and the document list error UI. This allows users to easily share the error stack trace with developers.
  • Please note that these new strings cannot be internationalized because the global error UI is rendered outside of the locale provider.

Copy link

vercel bot commented Sep 18, 2024

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

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2024 8:52am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2024 8:52am
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2024 8:52am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2024 8:52am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2024 8:52am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Sep 24, 2024 8:52am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Sep 18, 2024

Component Testing Report Updated Sep 24, 2024 8:56 AM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 47s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 31s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 37s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 18s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 10s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 3m 0s 0 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 46s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 47s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 17s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 9s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 27s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 18s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 37s 12 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

@juice49 juice49 marked this pull request as ready for review September 19, 2024 10:36
@juice49 juice49 requested a review from a team as a code owner September 19, 2024 10:36
@juice49 juice49 requested review from cngonzalez and removed request for a team September 19, 2024 10:36
cngonzalez
cngonzalez previously approved these changes Sep 23, 2024
Copy link
Member

@cngonzalez cngonzalez left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me, and a great addition! Just one minor nit.

Copy link
Contributor

@RitaDias RitaDias left a comment

Choose a reason for hiding this comment

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

🚀

@juice49 juice49 merged commit a218c88 into next Sep 24, 2024
42 checks passed
@juice49 juice49 deleted the feat/corel-172/refine-errory-boundary-ui branch September 24, 2024 09:07
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.

3 participants