Add error boundary around trade panel#550
Closed
Tijesunimi004 wants to merge 1 commit into
Closed
Conversation
An unhandled render error in the trade buy/sell buttons previously propagated up to the shared Creator Profile section boundary, taking out profile facts and stats along with the panel. Wrap the desktop and mobile trade panel blocks in a dedicated TradePanelErrorBoundary so a panel failure shows a compact inline fallback with a retry button while the rest of the page stays mounted.
✅ Deploy Preview for accesslayer ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hey @Tijesunimi004, thanks for your contribution! This PR is targeting Please close this PR and reopen it with Closing this PR automatically. See you in |
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
Fixes #542. An unhandled render error in the trade buy/sell controls previously bubbled up to the shared "Creator Profile"
SectionErrorBoundary, which also wraps profile facts and stats — so a trade panel crash took the whole profile section down with it, not just the panel.Changes
TradePanelErrorBoundary(src/components/common/TradePanelErrorBoundary.tsx), a class-component error boundary that catches render errors and shows a compact inline fallback (short message + retry button) sized to fit both the desktop profile row and the fixed mobile bottom bar.LandingPage.tsxwithTradePanelErrorBoundary, nested inside the existing "Creator Profile" boundary.TradePanelErrorBoundary.test.tsxcovering: normal render, fallback UI on error, and retry resetting the boundary and remounting the panel.Test plan
tsc -b --noEmitpasseseslinton changed files passesvitest run src/components/common/__tests__/TradePanelErrorBoundary.test.tsx(could not execute locally —@swc/corenative binding is corrupted in this sandbox environment; relying on CI to run the suite)SectionErrorBoundaryand are unaffected by a trade panel error