[PR #1688] [MERGED] Add global client error boundary #5214

Closed
opened 2026-10-22 04:14:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1688
Author: @cha1latte
Created: 5/31/2026
Status: ✅ Merged
Merged: 5/31/2026
Merged by: @cha1latte

Base: refactor ← Head: feature/refactor-global-error-boundary


📝 Commits (2)

  • 7c24ddc Add refactor global error boundary
  • 80480a2 Address global boundary review feedback

📊 Changes

5 files changed (+431 additions, -115 deletions)

View changed files

➖ src/app/AppErrorBoundary.test.tsx (+0 -39)
➖ src/app/AppErrorBoundary.tsx (+0 -72)
➕ src/app/GlobalErrorBoundary.test.tsx (+159 -0)
➕ src/app/GlobalErrorBoundary.tsx (+262 -0)
📝 src/app/main.tsx (+10 -4)

📄 Description

Linked issue

None.

Why this change

  • Add a root-level React crash recovery surface for the refactor app so render/lifecycle errors do not leave the UI locked with little debugging context.
  • Correction note: #1683 was opened against staging by mistake and has been returned to draft; this branch targets refactor.

What changed

  • Replaced the minimal AppErrorBoundary with GlobalErrorBoundary.
  • Added a full-screen crash fallback with user-safe copy, error name/message, collapsible debug details, reload, and copy-debug actions.
  • Wired React 19 createRoot error callbacks for caught, uncaught, and recoverable root errors.
  • Added diagnostic-only window.error and unhandledrejection listeners.
  • Suppressed duplicate window error logs for React root uncaught errors.
  • Added focused Vitest coverage for normal render, crash fallback, debug copy, reload, and duplicate diagnostic suppression.

Refactor impact

Primary owner:

app shell

Impact areas reviewed:

  • src/app root bootstrap
  • Root React provider ordering
  • Existing local EncounterErrorBoundary remains unchanged

Boundary notes:

  • UI-only app shell change.
  • No engine, shared API, storage, Rust, schema, prompt, or remote-runtime behavior changes.

Pressure points touched:

  • React root bootstrap in src/app/main.tsx
  • Global crash fallback UI in src/app/GlobalErrorBoundary.tsx

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

Codex-run validation:

  • pnpm test -- src/app/GlobalErrorBoundary.test.tsx passed: 5 tests.
  • pnpm typecheck passed.
  • pnpm build passed.
  • pnpm check passed, including line endings, architecture, frontend, Rust check, and docs check.

Not manually verified in a browser/Tauri runtime. The crash fallback behavior is covered by the jsdom render harness.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs changes needed.

UI evidence

No screenshot evidence added. UI behavior is covered by the focused Vitest harness.

Summary by CodeRabbit

  • New Features

    • Enhanced error handling with global diagnostics for unhandled runtime errors.
    • Added ability to copy debug details to clipboard when the app crashes.
  • Refactor

    • Replaced app-level error boundary with improved global error recovery system.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1688 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/31/2026 **Status:** ✅ Merged **Merged:** 5/31/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `feature/refactor-global-error-boundary` --- ### 📝 Commits (2) - [`7c24ddc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7c24ddcd1c8d7fb7e4ac2180eb68bd25206ca2f3) Add refactor global error boundary - [`80480a2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/80480a239bc9a6dec60b1117ffbce417853d6a05) Address global boundary review feedback ### 📊 Changes **5 files changed** (+431 additions, -115 deletions) <details> <summary>View changed files</summary> ➖ `src/app/AppErrorBoundary.test.tsx` (+0 -39) ➖ `src/app/AppErrorBoundary.tsx` (+0 -72) ➕ `src/app/GlobalErrorBoundary.test.tsx` (+159 -0) ➕ `src/app/GlobalErrorBoundary.tsx` (+262 -0) 📝 `src/app/main.tsx` (+10 -4) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue None. ## Why this change - Add a root-level React crash recovery surface for the refactor app so render/lifecycle errors do not leave the UI locked with little debugging context. - Correction note: #1683 was opened against `staging` by mistake and has been returned to draft; this branch targets `refactor`. ## What changed - Replaced the minimal `AppErrorBoundary` with `GlobalErrorBoundary`. - Added a full-screen crash fallback with user-safe copy, error name/message, collapsible debug details, reload, and copy-debug actions. - Wired React 19 `createRoot` error callbacks for caught, uncaught, and recoverable root errors. - Added diagnostic-only `window.error` and `unhandledrejection` listeners. - Suppressed duplicate window error logs for React root uncaught errors. - Added focused Vitest coverage for normal render, crash fallback, debug copy, reload, and duplicate diagnostic suppression. ## Refactor impact Primary owner: app shell Impact areas reviewed: - `src/app` root bootstrap - Root React provider ordering - Existing local `EncounterErrorBoundary` remains unchanged Boundary notes: - UI-only app shell change. - No engine, shared API, storage, Rust, schema, prompt, or remote-runtime behavior changes. Pressure points touched: - React root bootstrap in `src/app/main.tsx` - Global crash fallback UI in `src/app/GlobalErrorBoundary.tsx` ## Validation - [ ] `pnpm check` passes locally - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Codex-run validation: - `pnpm test -- src/app/GlobalErrorBoundary.test.tsx` passed: 5 tests. - `pnpm typecheck` passed. - `pnpm build` passed. - `pnpm check` passed, including line endings, architecture, frontend, Rust check, and docs check. Not manually verified in a browser/Tauri runtime. The crash fallback behavior is covered by the jsdom render harness. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims No docs changes needed. ## UI evidence No screenshot evidence added. UI behavior is covered by the focused Vitest harness. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Enhanced error handling with global diagnostics for unhandled runtime errors. * Added ability to copy debug details to clipboard when the app crashes. * **Refactor** * Replaced app-level error boundary with improved global error recovery system. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:14:17 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5214
No description provided.