feat: add 'Report this error' button to hard-error panels
Summary
- Adds a "Report this error" button to both hard-error panels in
src/main.jsx(theBootstrap"Couldn't start" recovery and the top-levelErrorBoundary"Something broke"), refactored behind a shared<BootErrorPanel>component. - Clicking opens a new
<ErrorReportModal/>(src/ui/error-report-modal.jsx) that auto-captures the timestamp, tool version + deploy target, error message + stack, user agent, and current URL, and lets the user add a free-text comment. - Two submission routes — neither requires new OAuth scopes (both are user-action
window.open()to pre-filled URLs):-
Open Phabricator task — Maniphest create-task form with
titleanddescriptionpre-filled, project pinned totool-upload-workbench. -
Post to User talk:Daanvr — Commons edit-section-new form with
preloadtitlepre-filled, plus a "Copy text" button (MediaWiki'spreloadURL param loads a wiki-template page, not a literal string, so the body is copied to the clipboard for the user to paste).
-
Open Phabricator task — Maniphest create-task form with
Phabricator
- T426408 — Add 'Report this error' button to hard-error panels
Test plan
- Open the preview URL — confirm the app loads normally when there's no error.
-
In the DevTools console, throw an uncaught error (e.g.
setTimeout(() => { throw new Error('test'); }, 0)from inside a React render path — or just navigate to a malformed URL the app can't parse) to surface theErrorBoundary"Something broke" panel.- Confirm the new "Report this error" button appears next to Reload.
- Click it — confirm the modal opens with the timestamp / version / error / URL filled in.
- Type a comment — confirm the body textarea updates as the comment is typed (until the user hand-edits the body, then it freezes).
- Click "Open Phabricator task" — confirm a new tab opens to the Maniphest create-task form with the title and description pre-filled.
- Click "Post to User talk:Daanvr" — confirm a new tab opens to the talk-page edit form, and the report body is on the clipboard (paste anywhere to verify).
- Click "Copy text" alone — confirm the clipboard receives the body.
- Click "Cancel" / press Esc — confirm the modal dismisses without doing anything.
-
Confirm the "Couldn't start" panel (Bootstrap failure path) renders the same way — easiest to trigger by setting
VITE_OWNER_ACCESS_TOKEN=invalidlocally and reloading, or revoking the token mid-session. -
npm run buildpasses (including the undefined-identifier scanner).
Generated with Claude Code