feat(session): add Community Dispute Appeal Form UI (#338)#381
Conversation
📝 WalkthroughWalkthroughAdds shared Dispute Appeal UI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 `@src/app/session/`[id]/page.tsx:
- Around line 54-65: Update the session page logic so the dispute mock is only
attached to the matching active session instead of always using MOCK_DISPUTE. In
the session page component that defines MOCK_DISPUTE and computes
sessionDispute, gate the assignment by the current route/session id (and apply
the same fix to the duplicated logic in the other referenced block) so
non-matching sessions do not expose the appeal entry point. Use the existing
session id lookup in the page component to scope the dispute correctly.
- Around line 363-368: The appeal modal is being closed too early in the session
page flow, which prevents the new success step from rendering. Update the
`AppealFormModal` usage in `page.tsx` so `onAppealSubmitted` no longer calls
`setShowAppealModal(false)`; let `AppealForm.handleSubmit()` advance to the
success state first, and only close the modal from the user’s explicit close
action or after the success screen is dismissed.
In `@src/components/session/AppealForm.tsx`:
- Line 12: Remove the unused Trash2 import from AppealForm to satisfy linting
and avoid CI failures. Update the import list in the AppealForm component so
only actually referenced symbols remain; this is a simple cleanup with no
behavior change.
- Around line 326-333: The custom upload trigger in AppealForm should support
keyboard activation with both Enter and Space since it uses role="button".
Update the onKeyDown handler on the upload div so it also opens the file picker
when Space is pressed, while keeping the existing click behavior and
fileInputRef.current?.click() usage intact.
🪄 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
Run ID: f2851a70-a45e-4146-9dbd-a85f93e6d974
📒 Files selected for processing (3)
src/app/session/[id]/page.tsxsrc/components/session/AppealForm.tsxutils/types/types.ts
| Info, | ||
| Paperclip, | ||
| SendHorizonal, | ||
| Trash2, |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Remove the unused Trash2 import.
ESLint already flags this, and it will keep the file noisy or CI red if lint is enforced.
🧰 Tools
🪛 ESLint
[error] 12-12: 'Trash2' is defined but never used.
(@typescript-eslint/no-unused-vars)
🤖 Prompt for 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.
In `@src/components/session/AppealForm.tsx` at line 12, Remove the unused Trash2
import from AppealForm to satisfy linting and avoid CI failures. Update the
import list in the AppealForm component so only actually referenced symbols
remain; this is a simple cleanup with no behavior change.
Source: Linters/SAST tools
feat(session): Community Dispute Appeal Form UI
Summary
Implements the appeal submission screen for contested dispute decisions, as specified in issue #338.
New component -
src/components/session/AppealForm.tsxAppealForm- inline card variant, conditionally rendered only when a session has a resolved disputeAppealFormModal- modal wrapper for triggering the form as an overlayTypes -
utils/types/types.tsDispute,DisputeEvidence,DisputeVerdict, andAppealFormDatainterfacesIntegration -
src/app/session/[id]/page.tsxsessionDispute?.status === "resolved"AppealFormModalis mounted conditionally on the same guardWhat the form includes
Acceptance Criteria
dispute.status === "resolved")Tested
Manual review of component logic and TypeScript types. Pre-existing tsconfig-level type errors in the repo are unrelated to this change.
Closes #338
Summary by CodeRabbit
New Features
Bug Fixes