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

Open
wants to merge 5 commits into
base: next
Choose a base branch
from

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 19, 2024 10:32am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2024 10:32am
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2024 10:32am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2024 10:32am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2024 10:32am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Sep 19, 2024 10:32am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Sep 18, 2024

Component Testing Report Updated Sep 19, 2024 10:35 AM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 45s 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) 11s 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 43s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 18s 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) 19s 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

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.

1 participant