ui-patterns: shared error pages with a support reference - #146
Merged
Conversation
Lifts the full-page error views ml-trainer and classroom each carry into ui-patterns so the Python Editor can use them too and there is one place to maintain them. - ErrorPage: the shared layout, also for an app's own terminal states such as ml-trainer's stored-data version page. Content is vertically centred rather than a third of the way down, so it survives short viewports, and focus moves to the heading on mount so a screen reader user learns the page has been replaced. - UnexpectedErrorPage: apology, support link, optional error reference and a reload button. The reference is the Sentry event id, shown so a support request quoting it can be matched to the report, with a copy button because an event id is too long to retype reliably; this is the part classroom prototyped on its sentry-error-reference branch. - NotFoundPage: the unknown-URL page with a link home, with the link text overridable for apps that name themselves in it. - ErrorBoundary: catches render errors and renders a fallback the app supplies. Its onError callback is where the app reports the error and can return the reference for the fallback to show, which fills the logging gap in ml-trainer's boundary. Titles that were hardcoded English in both apps are messages here. Route-level errorElements stay app-side, as they need react-router.
Deploying ui with
|
| Latest commit: |
e8dd631
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7b6e299e.ui-2wg.pages.dev |
| Branch Preview URL: | https://error-views.ui-2wg.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lifts the full-page error views ml-trainer and classroom each carry into ui-patterns so the Python Editor can use them too and there is one place to maintain them.
Titles that were hardcoded English in both apps are messages here. Route-level errorElements stay app-side, as they need react-router. No real rush to translate any of this given it was an English fallback page before.