Skip to content

test(desktop): story-cover the renderer crash fallback - #3947

Open
liuxiaocs7 wants to merge 1 commit into
apache:mainfrom
liuxiaocs7:liuxiaocs7/test-desktop-the-crash-fallback-has-no-story
Open

test(desktop): story-cover the renderer crash fallback#3947
liuxiaocs7 wants to merge 1 commit into
apache:mainfrom
liuxiaocs7:liuxiaocs7/test-desktop-the-crash-fallback-has-no-story

Conversation

@liuxiaocs7

@liuxiaocs7 liuxiaocs7 commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

The top-level renderer ErrorBoundary (apps/desktop/src/renderer/error-boundary.tsx) had no Storybook coverage — it is the surface hardest to reach in normal use and the one whose correctness matters most when reached, so its four copyState values and the repeat-error path could only be seen by actually crashing the app.

This PR extracts the fallback face into a pure presentational ErrorBoundaryFallback component (the class still owns all state and side effects, so behavior is unchanged), then adds one story per state — default fallback, copy pending, copied, copy failed, repeat error — each with a // Real path: annotation per stories/FIDELITY.md. Rendering the fallback directly rather than triggering a real throw keeps the render smoke free of the console.error that componentDidCatch would otherwise emit.

Fixes #3943

Verification

Ran locally, all passing:

  • biome lint — clean
  • tsc (tsconfig.storybook.json + tsconfig.renderer.json)
  • npm run build-storybook — all five product-shell-error-boundary--* in the index
  • npm run smoke:storybookStorybook render smoke passed (200 stories)., all five new stories render clean

The five states are visible in Storybook under Product/Shell/Error Boundary; the render smoke above is the command-output evidence that each mounts without runtime, console, or AX errors.

error-boundary--default-fallback error-boundary--repeat-error

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code assisted with the ErrorBoundaryFallback extraction and the story authoring; the design decisions and verification are my own. The affected commit carries a Generated-by: Claude Code trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@liuxiaocs7 liuxiaocs7 changed the title test(desktop): story-cover the renderer crash fallback (#3943) test(desktop): story-cover the renderer crash fallback Aug 26, 2026
The top-level renderer ErrorBoundary is the surface hardest to reach in
normal use and the one whose correctness matters most when reached: a
crash the user cannot read or copy is a crash we never hear about. It had
no Storybook coverage, so its four copyState values and repeat-error path
could only be seen by actually crashing the app (and the failed-copy
state only by additionally failing the clipboard bridge).

Extract the fallback face into a pure presentational ErrorBoundaryFallback
component (the class still owns all state and side effects) so each state
renders directly, then add one story per state — default fallback, copy
pending, copied, copy failed, and repeat error — following the FIDELITY
conventions in apps/desktop/stories. Rendering the fallback directly (no
real throw) keeps the render smoke free of the console.error that
componentDidCatch would otherwise emit.

Ran biome lint, tsc (stories and renderer), build-storybook, and the
storybook render smoke (200 stories, all five error-boundary stories).

Generated-by: Claude Code
@liuxiaocs7
liuxiaocs7 force-pushed the liuxiaocs7/test-desktop-the-crash-fallback-has-no-story branch from 82fc14b to 3e1ba88 Compare August 26, 2026 17:39
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(desktop): the crash fallback has no story

1 participant