Skip to content

Implement Apply for Slot on Multi-Winner Milestone bounties #204

Description

@Benjtalkshow

On a MULTI_WINNER_MILESTONE bounty, the sidebar CTA shows an "Apply for Slot [Coming soon]" button that runs a stub click handler. Contributors can't actually apply for a slot, and the slot counter on the bounty card never moves.

We need a real apply action that increments the slot occupancy and adds the contributor to the milestone funnel.

What to do

Add a useApplyForSlot mutation in hooks/use-bounty-application.ts accepting bountyId and applicantAddress. Optimistically:

  • Increment totalSlotsOccupied on the bounty detail in the cache
  • Append the applicant to contributorProgress at the first milestone
  • Roll back on error

In components/bounty-detail/bounty-detail-sidebar-cta.tsx (both SidebarCTA and MobileCTA), replace the stub click handler with a call to the new mutation. Drop the [Coming soon] suffix from the button label and disable the button only when the slot count is full, the user is already in contributorProgress, or the session doesn't have a wallet address.

Acceptance criteria

  • Eligible contributor can click Apply for Slot and join the bounty
  • totalSlotsOccupied / maxSlots count on the sidebar and the bounty card reflects the new count after applying
  • Contributor's avatar appears in the milestone funnel
  • Button reads "Slots Full" and disables when the bounty is at capacity
  • Button reads "Already Joined" and disables for an applicant already in the bounty

Files

  • components/bounty-detail/bounty-detail-sidebar-cta.tsx
  • hooks/use-bounty-application.ts

Activity

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions