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
The sidebar CTA at
components/bounty-detail/bounty-detail-sidebar-cta.tsxshows a disabled "Raise a Dispute (Coming Soon)" button to eligible users. We have the dispute review page atapp/dispute/[disputeId]/page.tsxand the GraphQL operations atlib/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
useRaiseDisputemutation inhooks/use-bounty-application.tsacceptingbountyId,reason(fromDisputeReasonEnum), anddescription. 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:disabledprop on the trigger button so the dialog can open/dispute/{newDisputeId}The
useCanRaiseDisputehook already gates the button visibility. No change needed there.Acceptance criteria
IN_PROGRESSorUNDER_REVIEW) see an active Raise Dispute buttonFiles
components/bounty-detail/bounty-detail-sidebar-cta.tsxhooks/use-bounty-application.tslib/graphql/operations/admin-dispute.graphql