Skip to content

Add bounty detail page and update sidebar CTA - #197

Closed
Belzabeem wants to merge 1 commit into
boundlessfi:mainfrom
Belzabeem:main
Closed

Add bounty detail page and update sidebar CTA#197
Belzabeem wants to merge 1 commit into
boundlessfi:mainfrom
Belzabeem:main

Conversation

@Belzabeem

@Belzabeem Belzabeem commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

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

  • New Features
    • Participants can now raise disputes on bounties, selecting a dispute reason and providing a description
    • Added admin dispute review interface for resolving disputes with detailed notes and action options
    • Extended application and submission statuses to support a new "disputed" state

- 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
@vercel

vercel Bot commented Apr 28, 2026

Copy link
Copy Markdown

@Codex723 is attempting to deploy a commit to the Threadflow Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Dispute Raising UI
components/bounty-detail/bounty-detail-sidebar-cta.tsx
Adds eligibility logic (isParticipant, canRaiseDispute), a dispute trigger button in the sidebar, and a modal dialog for users to select dispute reason and enter description. Includes submission state management and a placeholder handler with success toast feedback.
Dispute Review & Resolution
app/dispute/[disputeId]/page.tsx
Creates an admin page that loads dispute details via GraphQL query, displays dispute reason/description with campaign/milestone context, provides a textarea for mandatory resolution notes, and two action buttons wired to a GraphQL mutation for dispute resolution with different outcomes. Includes loading states, error handling, and navigation on success.
Type Extensions
types/participation.ts
Extends ApplicationStatus and SubmissionStatus types to include a new "disputed" state alongside existing statuses.

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
Loading
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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • feat: Implement bounties detail page #88: Modified components/bounty-detail/bounty-detail-sidebar-cta.tsx to add the component file initially; this PR extends it with the "Raise Dispute" flow implementation.
  • Feat/competition bounty flow #178: Modified the same components/bounty-detail/bounty-detail-sidebar-cta.tsx file with updates to SidebarCTA and MobileCTA logic and UI.

Suggested reviewers

  • Benjtalkshow
  • 0xdevcollins

Poem

🐰✨ A dispute arises, but fear not, dear friend,
Our whisker-approved workflow brings peace in the end!
From raise to resolve, each step gleams so bright,
With modals and mutations, we've set justice right. 🏛️
The bounties now flourish with fairness and grace,
As disputes find their home in this trustworthy place!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is partially related to the changeset, referring to updates to sidebar CTA but omitting the critical dispute resolution feature that forms the core of the changes. Revise the title to highlight the primary change: 'Implement decentralized dispute resolution flow for bounties' or similar, which better reflects the full scope of the work.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully implements all coding requirements from issue #134: adds DISPUTED status to types, implements Raise Dispute button with modal/sidebar CTA, creates dispute review page with resolution actions, and manages submission states.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the dispute resolution feature requirements. Type updates, sidebar CTA enhancements, and dispute review page are all in scope per issue #134.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Belzabeem Belzabeem closed this Apr 28, 2026
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.

Decentralized Dispute Resolution Flow

2 participants