Skip to content

feat(resilience): add glassmorphic ErrorBoundary and custom 404 page (#56, #65) - #90

Merged
ajithakdev merged 1 commit into
mainfrom
feat/resilience-error-boundary-and-404
Sep 6, 2026
Merged

ajithakdev merged 1 commit into
mainfrom
feat/resilience-error-boundary-and-404

Conversation

@ajithakdev

@ajithakdev ajithakdev commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Resolves #56 and #65.

Summary of Changes

  1. Reusable Glassmorphic ErrorBoundary (src/components/ErrorBoundary.tsx):

    • Class-based React error boundary with componentDidCatch and static getDerivedStateFromError.
    • 100% Client-Side Privacy: Zero remote telemetry, zero external logging.
    • User-friendly error card matching Toolglass's glassmorphic aesthetics.
    • Expandable technical details (closed by default) + "Copy Debug Info" button for optional manual issue reporting.
    • "Try Again" button that resets component state without page refresh.
    • Integrated in ToolPage.tsx (wrapping tool components) and in App.tsx (protecting the app shell).
  2. Custom 404 & Tool-Not-Found Page (src/pages/NotFound.tsx):

    • Beautiful glassmorphic 404 page with ✦ visual identity.
    • Replaced silent redirect with explicit feedback for invalid paths and tool slugs.
    • Fuzzy Tool Suggestions: Computes string similarity against registered tools to suggest matches (e.g. /#/tools/time-conv -> suggests Timestamp).
    • Embedded Search: Live inline search box on the 404 page.
    • "Explore All Tools" navigation button.
  3. Automated Unit & E2E Testing:

    • src/components/ErrorBoundary.test.tsx: 4 Vitest unit tests verifying normal rendering, error catching, fallback UI, and recovery via Try Again.
    • src/pages/NotFound.test.tsx: 4 Vitest unit tests verifying generic 404, tool-specific 404, fuzzy suggestions, and live search filtering.
    • All 28 unit tests passing cleanly.
    • Headless Chromium regression test passed with 0 console errors.

Closes #56
Closes #65


Devin Review

@netlify

netlify Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for toolglass-by-ajithakdev ready!

Name Link
🔨 Latest commit 9f6743f
🔍 Latest deploy log https://app.netlify.com/projects/toolglass-by-ajithakdev/deploys/6a9d81e3e059440008509f90
😎 Deploy Preview https://deploy-preview-90--toolglass-by-ajithakdev.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.

@ajithakdev
ajithakdev merged commit 31ca1ef into main Sep 6, 2026
6 of 7 checks passed
@ajithakdev
ajithakdev deleted the feat/resilience-error-boundary-and-404 branch September 6, 2026 15:09

@devin-ai-integration devin-ai-integration Bot 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.

Devin Review found 2 potential issues.

2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

Comment thread src/pages/ToolPage.tsx
<Suspense fallback={<Loader />}>
<Component />
</Suspense>
<ErrorBoundary toolTitle={tool.title}>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Error state survives route changes

After a tool crashes, navigateTo changes the slug while ErrorBoundary remains latched. The selected healthy tool displays an error card instead of rendering. The application boundary likewise ignores its fallback’s home navigation.

Prompt for agents
ErrorBoundary state persists independently of router location. In src/pages/ToolPage.tsx, navigating between /tools/:slug values through CommandPalette reuses the same boundary instance after an error, so the new tool never renders. Key or explicitly reset the tool boundary when the slug changes. The app-level boundary in src/App.tsx has the same stale-state behavior: its fallback's Return to Tools link changes location without clearing the boundary. Make navigation from that fallback reset or remount the application boundary as well, and add route-navigation recovery tests for both cases.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +46 to +52
this.setState({
hasError: false,
error: null,
errorInfo: null,
copied: false,
showDetails: false,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Chunk failures survive every retry

When a tool import rejects, resetError rerenders the same cached lazy component. Its rejection persists, so Try Again immediately returns to the error card after the network recovers.

Prompt for agents
The production tool components in src/tools/registry.tsx are singleton React.lazy objects. Once a dynamic import rejects, React.lazy retains the rejected payload. Clearing ErrorBoundary state in resetError therefore cannot retry the import. Add a recovery path that creates a fresh lazy import attempt or reloads the application for chunk-load failures, while preserving the current state-reset behavior for ordinary render errors. Cover a rejected lazy import followed by successful recovery in a test.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

feat: Custom 404 page with glassmorphic design & navigation feat: Add Error Boundary wrapper to catch tool-level crashes gracefully

1 participant