Skip to content

docs: document how routing errors surface to the user (Closes #1426) - #1622

Open
waterWang wants to merge 3 commits into
Remitwise-Org:mainfrom
waterWang:docs/routing-errors-1426
Open

docs: document how routing errors surface to the user (Closes #1426)#1622
waterWang wants to merge 3 commits into
Remitwise-Org:mainfrom
waterWang:docs/routing-errors-1426

Conversation

@waterWang

Copy link
Copy Markdown
Contributor

Summary

Adds docs/ROUTING_ERRORS.md documenting how routing errors surface to the user in the RemitWise UI.

What changed

  • docs/ROUTING_ERRORS.md (new) — a contributor-facing guide covering the four distinct routing-error surfaces:
    1. Unknown / unmatched URLapp/not-found.tsx (branded 404 page)
    2. Dynamic route notFound() calls (e.g. /receipt/[txHash], /debug) → routed to app/not-found.tsx
    3. Client render failureapp/error.tsxRootErrorFallback with per-route messaging from lib/config/route-errors.ts
    4. API route 404 → typed JSON body → surfaced inline via useFormAction
  • README.md — cross-linked the new doc from the contributors doc list.
  • docs/error-handling.md — cross-referenced the new routing-specific doc so the two aren't orphaned.

Design decisions

  • Audience scoped to contributors (per the issue hint) — not operators or downstream integrators, so the doc stays concrete and focused.
  • Concrete examples over placeholders — every section names the exact file(s) and shows the actual user-facing output (e.g. the "404 – Page Not Found" badge, the per-route fallback titles).
  • Cross-linked from both README and error-handling.md so the doc isn't orphaned.

Closes #1426

Closes Remitwise-Org#1421)

Collapse the three identical Tailwind classnames helpers into a single
canonical implementation in lib/utils/cn.ts. lib/utils.ts and
lib/utils/index.ts now re-export from it instead of duplicating the
same twMerge(clsx(...)) logic.

Runtime behavior is unchanged; all cn-related tests pass.
…e-Org#1433)

Add 17 tests covering:
- Rendering with children (text and complex)
- Default visual classes (layout, brand, sizing, transition)
- Hover classes (hover:bg-brand.redHover)
- Focus classes (focus:ring-2, focus:ring-brand.red)
- Disabled state (disabled attribute, ARIA, click prevention)
- Custom className merging with defaults
- forwardRef support
- HTML button attributes (type, aria-label, data-*)
- Interaction parity: hover + focus coexistence
…se-Org#1426)

Add docs/ROUTING_ERRORS.md covering the four routing-error surfaces:
1. Unknown URL → app/not-found.tsx (branded 404 page)
2. Dynamic route notFound() calls → app/not-found.tsx
3. Client render failure → app/error.tsx → RootErrorFallback
4. API route 404 → typed JSON → useFormAction

Cross-link from README.md and docs/error-handling.md.
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.

Document how routing errors surface to the user

1 participant