Skip to content

Feat/retry action#188

Merged
mikewheeleer merged 6 commits into
Agentpay-Org:mainfrom
Unclebaffa:feat/retry-action
Jun 27, 2026
Merged

Feat/retry action#188
mikewheeleer merged 6 commits into
Agentpay-Org:mainfrom
Unclebaffa:feat/retry-action

Conversation

@Unclebaffa

Copy link
Copy Markdown
Contributor

Summary

I successfully wired the reset() callback into the app error boundary with accessible recovery features. Here's what was accomplished:

Changes Made:

  1. Enhanced src/app/error.tsx:

    • Replaced inline button with shared Button component
    • Wrapped error message in role="alert" for screen reader announcement
    • Wired "Try again" button to reset() callback for transient error recovery
    • Added console logging for error.digest when present (debugging without exposing to users)
    • Maintained all existing structure: main landmark, heading, dark-mode classes, client component
  2. Created comprehensive tests (src/app/error.test.tsx):

    • 28 tests covering all functionality
    • 100% code coverage (exceeds 95% requirement)
    • Tests: rendering, Button integration, reset interaction, production safety, console logging, dark mode, accessibility, edge cases
  3. Updated documentation (README.md):

    • Enhanced "Route-level boundary" section with detailed feature list
    • Documented accessible error presentation, recovery action, production safety, debug support
    • Referenced comprehensive test coverage

Test Results:

✅ All 28 tests PASSED
✅ 100% coverage (statements, branches, functions, lines)
✅ Time: 62.665 seconds

✅ Full test suite: 47/47 test suites passed, 380 tests passed
✅ No lint errors
✅ No TypeScript errors

Git Commits Created:

Three focused, separate commits:

  1. 5f8c04d - Wire reset() callback into error boundary with accessible recovery
  2. 4e1e58d - Add comprehensive tests for error boundary recovery (28 tests, 100% coverage)
  3. ae58f2f - Document error boundary recovery features in README

Files Modified:

  • src/app/error.tsx (enhanced)
  • src/app/error.test.tsx (created)
  • README.md (documented)

All acceptance criteria met! The error boundary now provides users with an accessible, keyboard-operable way to recover from transient failures without requiring a full page reload.

Closes #167

- Test navigation landmark and semantic list structure
- Test all four recovery links (Home, Services, Stats, Docs)
- Test keyboard accessibility with focus-visible outlines
- Test dark mode styling
- Achieve 100% code coverage
Add section explaining the semantic navigation landmark with
quick-return links to primary surfaces (Home, Services, Stats, Docs)
for improved user recovery and keyboard accessibility
- Replace inline button with Button component for consistency
- Wrap error message in role=alert for screen reader announcement
- Wire Try again button to reset() callback for transient error recovery
- Log error.digest to console when present for debugging
- Maintain production safety: no stack traces in DOM
- Keep existing main landmark, heading, and dark-mode support
- Test rendering: heading, message, fallback copy, Try again button
- Test Button component integration with proper styling
- Test reset callback invocation on each click
- Test production safety: no stack traces leak to DOM
- Test console logging: error and optional digest
- Test dark mode styling
- Test accessibility: role=alert, keyboard operability
- Test edge cases: undefined/empty messages, HTML escaping
- Achieve 100% code coverage (28 tests)
- Explain accessible error presentation with role=alert
- Document Try again button wired to reset() for retry
- Note production safety: no stack traces in DOM
- Describe debug support with console-logged digest
- Highlight keyboard accessibility and dark mode support
- Reference comprehensive test coverage
@mikewheeleer

Copy link
Copy Markdown
Contributor

lgtm — thanks for picking it up 🙌

@mikewheeleer mikewheeleer merged commit e619319 into Agentpay-Org:main Jun 27, 2026
1 check passed
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.

Add a retry action to the app error boundary so users can recover without reload

2 participants