Skip to content

Implement the Raise Dispute submission and route to the dispute review page #203

Description

@Benjtalkshow

The sidebar CTA at components/bounty-detail/bounty-detail-sidebar-cta.tsx shows a disabled "Raise a Dispute (Coming Soon)" button to eligible users. We have the dispute review page at app/dispute/[disputeId]/page.tsx and the GraphQL operations at lib/graphql/operations/admin-dispute.graphql, but no path to actually file a dispute from a bounty.

We need to enable the button, collect the reason and description, and route the user to the dispute review flow.

What to do

Add a useRaiseDispute mutation in hooks/use-bounty-application.ts accepting bountyId, reason (from DisputeReasonEnum), and description. On success it should return the new dispute ID and invalidate the bounty detail query.

Restore the dispute AlertDialog in bounty-detail-sidebar-cta.tsx:

  • Drop the disabled prop on the trigger button so the dialog can open
  • Wire the form (reason Select + description Textarea) through the new mutation
  • On success, close the dialog, show a success toast, and redirect to /dispute/{newDisputeId}

The useCanRaiseDispute hook already gates the button visibility. No change needed there.

Acceptance criteria

  • Eligible users (creator or participant on a bounty in IN_PROGRESS or UNDER_REVIEW) see an active Raise Dispute button
  • Clicking it opens the existing AlertDialog with reason and description fields
  • Submitting redirects to the dispute detail page
  • Submitting with an empty reason or description keeps the dialog open and shows inline validation

Files

  • components/bounty-detail/bounty-detail-sidebar-cta.tsx
  • hooks/use-bounty-application.ts
  • lib/graphql/operations/admin-dispute.graphql

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions