Skip to content

Add error boundary around trade panel#550

Closed
Tijesunimi004 wants to merge 1 commit into
accesslayerorg:mainfrom
Tijesunimi004:fix/trade-panel-error-boundary
Closed

Add error boundary around trade panel#550
Tijesunimi004 wants to merge 1 commit into
accesslayerorg:mainfrom
Tijesunimi004:fix/trade-panel-error-boundary

Conversation

@Tijesunimi004

Copy link
Copy Markdown

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

  • Added 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.
  • Wrapped the desktop and mobile trade panel blocks in LandingPage.tsx with TradePanelErrorBoundary, nested inside the existing "Creator Profile" boundary.
  • Added TradePanelErrorBoundary.test.tsx covering: normal render, fallback UI on error, and retry resetting the boundary and remounting the panel.

Test plan

  • tsc -b --noEmit passes
  • eslint on changed files passes
  • vitest run src/components/common/__tests__/TradePanelErrorBoundary.test.tsx (could not execute locally — @swc/core native binding is corrupted in this sandbox environment; relying on CI to run the suite)
  • Manual review: header, creator profile facts, and holdings sections each have their own separate SectionErrorBoundary and are unaffected by a trade panel error

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.
Copilot AI review requested due to automatic review settings July 23, 2026 15:03
@netlify

netlify Bot commented Jul 23, 2026

Copy link
Copy Markdown

Deploy Preview for accesslayer ready!

Name Link
🔨 Latest commit 52c65c7
🔍 Latest deploy log https://app.netlify.com/projects/accesslayer/deploys/6a622d3ab8b8110008449012
😎 Deploy Preview https://deploy-preview-550--accesslayer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

👋 Hey @Tijesunimi004, thanks for your contribution!

This PR is targeting main directly. We use main for stable releases only — all contributions should be opened against the dev branch instead.

Please close this PR and reopen it with dev as the base branch. If you're unsure how to do that, you can change the base branch using the Edit button at the top of this PR page.

Closing this PR automatically. See you in dev! 🚀

@github-actions github-actions Bot closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants