Add bounty detail page and update sidebar CTA - #197
Conversation
- Add components/bounty-detail/page.tsx for bounty detail page - Add page.tsx root page - Update bounty-detail-sidebar-cta.tsx component - Update types/participation.ts types
|
@Codex723 is attempting to deploy a commit to the Threadflow Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis pull request implements a decentralized dispute resolution workflow for bounties. It adds a "Raise Dispute" flow to the bounty sidebar with eligibility checks and a modal for users to submit disputes, creates new admin pages for reviewing and resolving disputes with GraphQL mutations, and extends participation types to support a "disputed" status for applications and submissions. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SidebarUI as Sidebar UI
participant Modal
participant API as GraphQL API
participant Toast
User->>SidebarUI: Views bounty detail
SidebarUI->>SidebarUI: Check eligibility (isParticipant + canRaiseDispute)
alt User is eligible
SidebarUI->>SidebarUI: Show "Raise Dispute" button
User->>Modal: Click "Raise Dispute"
Modal->>User: Display dispute form (reason, description)
User->>Modal: Select reason & enter description
User->>Modal: Submit dispute
Modal->>API: Send dispute creation request
API->>API: Process & create dispute
API-->>Toast: Success response
Toast->>User: Show success notification
Modal->>Modal: Clear & close dialog
else User is not eligible
SidebarUI->>SidebarUI: Hide "Raise Dispute" button
end
sequenceDiagram
participant Admin
participant ReviewPage as Review Page
participant API as GraphQL API
participant DB as Database
participant Toast
participant Navigation
Admin->>ReviewPage: Navigate to dispute page
ReviewPage->>API: Fetch dispute details (admin query)
API->>DB: Query dispute data
DB-->>API: Return dispute + context
API-->>ReviewPage: Dispute data loaded
ReviewPage->>Admin: Display dispute, reason, description & context
Admin->>ReviewPage: Enter resolution notes
Admin->>ReviewPage: Click resolution action (Approve/Reject)
ReviewPage->>ReviewPage: Validate notes (non-empty)
alt Notes valid
ReviewPage->>API: Submit resolution mutation
API->>DB: Update dispute status & resolution
DB-->>API: Confirmation
API-->>Toast: Success response
Toast->>Admin: Show success notification
Navigation->>Navigation: Navigate back to /admin/disputes
else Notes empty
ReviewPage->>Admin: Disable resolution buttons
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Closes #134
Summary
This PR implements the decentralized dispute resolution flow for handling disagreements between sponsors and contributors on bounties.
Changes Made
Types Update (types/participation.ts)
Added DISPUTED status to both Application and Submission types
Ensured seamless integration with existing status workflows
Bounty Page Enhancement (app/bounty/[bountyId]/page.tsx)
Added role-gated "Raise Dispute" button for active participants (contributor/sponsor involved)
Button triggers dispute creation workflow with optional reason/details prompt
Visibility restricted to eligible users only
Dispute Review Page (app/dispute/[disputeId]/page.tsx)
Created dedicated arbitration interface for reviewers
Displays both sides: contributor submission/application and sponsor feedback/context
Provides reviewer actions:
Approve contributor
Approve sponsor
Request additional info (optional)
Tracks final decisions and updates relevant entity statuses
Implemented with accessible, responsive design
Features Implemented
Dispute status propagation to applications and submissions
Permission-based dispute initiation (only involved parties)
Comprehensive reviewer interface with complete context
Status updates upon resolution
Accessible and responsive UI for all user types
Testing Performed
Verified Disputed status reflects correctly on applications/submissions
Confirmed eligible users can raise disputes from bounty page
Validated reviewer page shows complete dispute context
Tested dispute resolution updates all affected entities
Checked permissions: only authorized users can raise/review disputes
Ensured accessible, responsive design across device sizes
Additional Considerations
Workflow designed for extensibility to future dispute types/mediation steps
Dispute events logged for audit and transparency
Notifications considered for dispute lifecycle events (raised/resolved)
This implementation improves trust and transparency by providing a formal mechanism for resolving disagreements while maintaining clear audit trails and role-based access controls.
Summary by CodeRabbit
New Features
Raise disputes from sidebar and mobile CTAs with required reason, confirmation dialog, and toasts
Dispute review page for authorized reviewers with approve/refund/request-info actions and dialogs
Bug Fixes / UI
New “Disputed” status badge styling
Simplified mobile CTA layout; inputs/buttons disable while submitting
Chores
Status types updated to include "disputed"
Summary by CodeRabbit