test(desktop): story-cover the renderer crash fallback - #3947
Open
liuxiaocs7 wants to merge 1 commit into
Open
Conversation
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
force-pushed
the
liuxiaocs7/test-desktop-the-crash-fallback-has-no-story
branch
from
August 26, 2026 17:39
82fc14b to
3e1ba88
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fourcopyStatevalues and the repeat-error path could only be seen by actually crashing the app.This PR extracts the fallback face into a pure presentational
ErrorBoundaryFallbackcomponent (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 perstories/FIDELITY.md. Rendering the fallback directly rather than triggering a real throw keeps the render smoke free of theconsole.errorthatcomponentDidCatchwould otherwise emit.Fixes #3943
Verification
Ran locally, all passing:
biome lint— cleantsc(tsconfig.storybook.json+tsconfig.renderer.json)npm run build-storybook— all fiveproduct-shell-error-boundary--*in the indexnpm run smoke:storybook—Storybook render smoke passed (200 stories)., all five new stories render cleanThe 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.
AI use
Select exactly one:
Tool(s) and scope: Claude Code assisted with the
ErrorBoundaryFallbackextraction and the story authoring; the design decisions and verification are my own. The affected commit carries aGenerated-by: Claude Codetrailer.Checklist
Does this PR entail a change in behavior?