perf: Improve error handling - #731
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ec94c1e5d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| type RouteErrorViewProps, | ||
| } from "@vitnode/core/views/error/route-error-view"; | ||
|
|
||
| export default function ErrorBoundary({ error, retry }: RouteErrorViewProps) { |
There was a problem hiding this comment.
Use the reset callback supplied by Next.js
When any new route boundary, modified global boundary, or generated-app boundary renders, Next.js supplies a reset callback rather than retry; destructuring retry therefore passes undefined into the view, and clicking “Try again” throws instead of rerendering the failed segment. Accept reset and pass it through, optionally renaming it during destructuring.
Useful? React with 👍 / 👎.
| @@ -272,7 +272,6 @@ export const DashboardBoardProvider = ({ | |||
| } | |||
|
|
|||
| setIsEditing(false); | |||
There was a problem hiding this comment.
Restore confirmation after saving the dashboard
After a successful layout mutation, this path now exits editing and refreshes without confirming that the update was saved. Restore a sonner success toast with a description so the completed edit provides the repository-required feedback.
AGENTS.md reference: AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
| @@ -121,14 +121,6 @@ export const WidgetSettingsDialog = ({ | |||
| } | |||
|
|
|||
| setOpen(false); | |||
There was a problem hiding this comment.
Restore confirmation after saving widget settings
When widget settings save successfully, the dialog now closes and schedules the card refresh without showing any confirmation; users cannot distinguish a completed save from a dismissal until they inspect the widget. Restore the removed sonner success toast and its description.
AGENTS.md reference: AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
| type RouteErrorViewProps, | ||
| } from "@vitnode/core/views/error/route-error-view"; | ||
|
|
||
| export default function ErrorBoundary({ error, retry }: RouteErrorViewProps) { |
There was a problem hiding this comment.
Declare the new entrypoints as arrow components
This and the other newly added ErrorBoundary, GlobalError, and Loading entrypoints use function declarations, contrary to the repository-wide requirement that React components use arrow functions. Convert these entrypoint components to arrow declarations and export them as defaults.
AGENTS.md reference: AGENTS.md:L7-L7
Useful? React with 👍 / 👎.
| </p> | ||
|
|
||
| {error.digest ? ( | ||
| <p className="text-muted-foreground/70 font-mono text-xs"> |
There was a problem hiding this comment.
Keep error reference text at least 14px
The error digest is rendered with Tailwind's text-xs size, which is normally 12px; the same class is used by the route error view. These references are user-facing text that may need to be read or relayed to support, so use at least text-sm to satisfy the repository's 14px minimum.
AGENTS.md reference: AGENTS.md:L50-L50
Useful? React with 👍 / 👎.
Improving Documentation
pnpm lint:fixto fix formatting issues before opening the PR.Description
What?
Why?