Skip to content

ui-patterns: shared error pages with a support reference - #146

Merged
microbit-matt-hillsdon merged 1 commit into
mainfrom
error-views
Sep 11, 2026
Merged

ui-patterns: shared error pages with a support reference#146
microbit-matt-hillsdon merged 1 commit into
mainfrom
error-views

Conversation

@microbit-matt-hillsdon

Copy link
Copy Markdown
Contributor

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. No real rush to translate any of this given it was an English fallback page before.

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.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: e8dd631
Status: ✅  Deploy successful!
Preview URL: https://7b6e299e.ui-2wg.pages.dev
Branch Preview URL: https://error-views.ui-2wg.pages.dev

View logs

@microbit-matt-hillsdon
microbit-matt-hillsdon merged commit d1967a4 into main Sep 11, 2026
4 checks passed
@microbit-matt-hillsdon
microbit-matt-hillsdon deleted the error-views branch September 11, 2026 17:14
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