refactor: deal with misc todo comments in frontend - #178
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe website now preserves nested API validation errors, maps them to form fields, displays background failures through a global dismissible banner, improves action and initial-load error UI, and replaces dashboard placeholders with the AMA icon. ChangesError handling and dashboard updates
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant QueryCache
participant errorBannerMessagesAtom
participant ErrorBanner
QueryCache->>errorBannerMessagesAtom: pushErrorBanner(message)
errorBannerMessagesAtom-->>ErrorBanner: Provide queued messages
ErrorBanner->>errorBannerMessagesAtom: dismissErrorBanner(id)
Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/website/src/api/error.ts`:
- Around line 5-7: Preserve the complete Zod treeified-error payload: in
apps/website/src/api/error.ts at lines 5-7 and 45-54, retain the root node’s
errors, properties, and items, and update fieldError(...) to traverse both
properties and items; in apps/website/src/api/fetch.ts at lines 34-41, forward
the complete error tree instead of passing only properties.
In
`@apps/website/src/app/dashboard/`[id]/ama/amas/[amaId]/_components/AMADetails.tsx:
- Around line 58-77: Prevent duplicate submissions in handleRepostPrompt and the
AMA-ending handler by guarding against in-flight mutations before invoking
mutateAsync. Disable the corresponding repost and end-confirmation controls
while their mutations are pending, and restore the controls after completion or
failure.
- Around line 80-86: Add role="alert" to the actionError paragraph in AMADetails
so failed actions are announced to screen readers while focus remains on the
triggering button; preserve the existing styling and conditional rendering.
In `@apps/website/src/app/dashboard/`[id]/settings/_components/AddGrantCard.tsx:
- Around line 32-41: Update the APIError handling in AddGrantCard so statuses
other than 404, 422, and 400 also call setError with a generic fallback or the
API-provided message before returning. Preserve the existing status-specific
messages and fieldError handling.
In `@apps/website/src/components/common/ErrorBanner.tsx`:
- Around line 17-19: Update the ErrorBanner container div to include a
live-region semantic such as role="status", ensuring newly rendered error
messages are announced to assistive technology while preserving the existing
styling and message content.
In `@apps/website/src/components/common/Providers.tsx`:
- Around line 16-18: Use one shared Jotai store for ErrorBanner state: update
apps/website/src/api/errorBanner.ts lines 16-22 to expose or reuse the store
instance, and pass that same instance to JotaiProvider in
apps/website/src/components/common/Providers.tsx lines 16-18. Ensure
pushErrorBanner and dismissErrorBanner continue writing to the store consumed by
ErrorBanner.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 59d5a5d0-d1a2-45dd-bab6-9684b6f09660
📒 Files selected for processing (12)
apps/website/src/api/error.tsapps/website/src/api/errorBanner.tsapps/website/src/api/fetch.tsapps/website/src/api/queryClient.tsapps/website/src/app/dashboard/[id]/ama/amas/[amaId]/_components/AMADetails.tsxapps/website/src/app/dashboard/[id]/ama/amas/new/_components/CreateAMAForm.tsxapps/website/src/app/dashboard/[id]/ama/page.tsxapps/website/src/app/dashboard/[id]/page.tsxapps/website/src/app/dashboard/[id]/settings/_components/AddGrantCard.tsxapps/website/src/components/common/ErrorBanner.tsxapps/website/src/components/common/Providers.tsxapps/website/src/components/user/UserErrorHandler.tsx
💤 Files with no reviewable changes (1)
- apps/website/src/app/dashboard/[id]/page.tsx
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/website/src/api/error.ts`:
- Around line 6-9: Update the ZodErrorTree interface in error.ts so properties
and items are optional and items accepts null entries, matching treeifyError()
and JSON payloads. Apply the same shape to the matching payload type in
fetch.ts, and widen fieldError()’s local node type to allow null values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e57e4f26-7a2c-4a5c-8530-819c3ddfe9f6
📒 Files selected for processing (10)
apps/website/src/api/error.tsapps/website/src/api/errorBanner.tsapps/website/src/api/fetch.tsapps/website/src/api/routes/auth.tsapps/website/src/api/store.tsapps/website/src/app/dashboard/[id]/ama/amas/[amaId]/_components/AMADetails.tsxapps/website/src/app/dashboard/[id]/settings/_components/AddGrantCard.tsxapps/website/src/components/common/ErrorBanner.tsxapps/website/src/components/common/NavGate.tsxapps/website/src/components/common/Providers.tsx
🚧 Files skipped from review as they are similar to previous changes (6)
- apps/website/src/components/common/Providers.tsx
- apps/website/src/api/errorBanner.ts
- apps/website/src/components/common/ErrorBanner.tsx
- apps/website/src/app/dashboard/[id]/ama/amas/[amaId]/_components/AMADetails.tsx
- apps/website/src/app/dashboard/[id]/settings/_components/AddGrantCard.tsx
- apps/website/src/api/fetch.ts
Closes #133
Summary by CodeRabbit