From 557703f86d173f41ab2d193b6190ec3e9e2d6cf9 Mon Sep 17 00:00:00 2001 From: Thom Lamb Date: Thu, 20 Aug 2026 18:12:59 -0500 Subject: [PATCH] docs: mark the error-boundary design implemented (#62) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Records the two things the design got wrong. antd's Result renders its title as a plain div, so the design's Result usage and its getByRole('heading') assertions contradicted each other and the tests could never have passed as written — resolved by giving the title real heading semantics rather than by loosening the assertion, because an error page with no heading leaves a screen-reader user navigating by headings nothing to find. And import.meta.env had no ambient declaration anywhere in the app, so the DEV gate did not type-check until vite-env.d.ts was added. The Vite error overlay risk the design flagged did not materialise. Refs #62 Co-Authored-By: Claude Opus 5 --- .../specs/2026-08-20-error-boundary-design.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/superpowers/specs/2026-08-20-error-boundary-design.md b/docs/superpowers/specs/2026-08-20-error-boundary-design.md index 1b325db..0e358b0 100644 --- a/docs/superpowers/specs/2026-08-20-error-boundary-design.md +++ b/docs/superpowers/specs/2026-08-20-error-boundary-design.md @@ -2,7 +2,7 @@ **Issue:** [#62 — No React error boundary](https://gitea.bermudalamb.synology.me/bermudalamb/redefined-designs/issues/62) **Date:** 2026-08-20 -**Status:** Approved +**Status:** Implemented ## Goal @@ -148,6 +148,16 @@ Assertions are on the three distinct fallback titles, so a test cannot pass beca The new frontend files use deep imports from `antd/es/*`, which is this project's documented convention and the style every recently-added file follows. Not `antd/lib/*`: #65 records that as the mistake which loads a second React context and breaks `ConfigProvider`. The nine files still using the `antd` barrel are #65's business, not this change's. +## Corrections found during implementation + +Two things this design got wrong, recorded here rather than left for the next reader to rediscover. + +**antd's `Result` renders its title as a plain `
`, with no heading semantics.** This design specified both a `Result` with a string title and end-to-end assertions using `getByRole('heading')` — two requirements that contradict each other, so the tests could never have passed as written. The fix was to give the title a real heading rather than to loosen the assertion: a page whose entire content is an error message, with nothing carrying heading semantics, offers a screen-reader user navigating by headings nothing at all to find. `ErrorFallback` now wraps the title in `Typography.Title`, and the assertion stands as it was. + +**`import.meta.env` had no ambient type declaration.** Nothing in this application had used `import.meta.env` before — the only Vite environment gating lived in `vite.config.ts` — so `tsc` rejected the `DEV` check outright with TS2339. `frontend/src/vite-env.d.ts` was added, which is the standard one-line Vite reference and pulls in no new dependency. + +One thing the design flagged as a risk did not materialise: Vite's error overlay never interfered with the Playwright run, so `vite.config.ts` was left alone. + ## Out of scope Error reporting to an external service, persisting errors, alerting, and a frontend unit-test suite — the last belongs to #72, which already owns it.