Skip to content

feat(bounty): wizard shell + step/draft machinery (#598)#613

Open
Benjtalkshow wants to merge 2 commits into
boundlessfi:feat/t-replacefrom
Benjtalkshow:feat/bounty-wizard-shell
Open

feat(bounty): wizard shell + step/draft machinery (#598)#613
Benjtalkshow wants to merge 2 commits into
boundlessfi:feat/t-replacefrom
Benjtalkshow:feat/bounty-wizard-shell

Conversation

@Benjtalkshow

Copy link
Copy Markdown
Collaborator

Closes #598. Part of the Bounty Configure (Host a Bounty) frontend epic (#603).

Targets feat/t-replace (not main) as requested. Stacked on #612 (#596 data layer) — until that merges this PR's diff also shows the #596 commit + the regenerated schema.d.ts.

What

Adds the bounty Configure wizard orchestrator and its step + draft state, mirroring the hackathon wizard. No AI assist.

  • components/organization/bounties/new/constants.tsStepKey (scope/mode/submission/reward/review), STEP_ORDER, BountyFormData, isBountyStepDataValid.
  • hooks/use-bounty-steps.ts — URL ?step= navigation (free-roam) + presentational step-status map.
  • hooks/use-bounty-draft.ts — lazy create (ensureDraftId) then per-section PATCH, resume via useDraft, and transformBountyFromApi (sections → form state; winnerCount derived from prize tiers, ISO dates trimmed for the datetime-local inputs).
  • components/organization/bounties/new/NewBountyTab.tsx — orchestrator wiring steps + draft + per-step save, persisting ?draftId= for resume, and threading the chosen mode from ModeTab into SubmissionModelTab (the one cross-tab link those FE: ModeTab (two-axis picker) + SubmissionModelTab (mode-conditional fields) #599 components needed).

Acceptance criteria

  • Navigates stepsuseBountySteps (?step=, back/forward/bookmark safe).
  • Autosaves sectionscreateSaveHandlersaveStep → PATCH, for the live ModeTab + SubmissionModelTab.
  • Resumes a draft by iduseBountyDraft resume + onDraftLoaded rebuilds step statuses and the first-incomplete step.

tsc --noEmit: 0 errors; ESLint + Prettier clean; production build green (all enforced by the pre-commit hook).

Scope note (deviation from the issue task list)

The issue bundles the publish + funding-confirmation/progress modals + funding-source selection + USDC pre-flight check into #598, but those depend on the use-bounty-publish hook (#601) and the Scope/Reward/Review tabs (#600), neither built yet. Rather than ship speculative funding UI that can't compile against the real publish hook, I:

This fully satisfies #598's acceptance criteria (navigate / autosave / resume) while keeping publish/funding in its natural home (#601).

…ow) (boundlessfi#596)

Adds the features/bounties/ data layer for the v1 app, mirroring
features/hackathons/. REST-only via the typed openapi-fetch client; every
server shape is aliased from the backend-generated schema so it cannot drift.

- types.ts: aliases the generated draft + escrow DTOs (BountyDraft,
  UpdateBountyDraftBody, the four section types, BountyEscrowOpResponse,
  PublishBountyEscrowRequest, ...). Derives the two-axis taxonomy from the
  generated mode DTO, superseding the local stubs in the ModeTab.
- api/keys.ts: bountyKeys factory.
- api/draft-client.ts + use-draft.ts: imperative CRUD plus the
  useDraft / useDraftList / useCreateDraft / useUpdateDraft / useDeleteDraft
  hooks against /organizations/{organizationId}/bounties/draft[/{id}] + /drafts.
- api/escrow-client.ts + use-escrow.ts: organizer escrow calls (publish /
  cancel / select-winners / submit-signed / poll) plus useEscrowOp +
  useEscrowOpRunner, mirroring the hackathon machinery (MANAGED polls; EXTERNAL
  signs -> submit -> poll) bounty-scoped.
- index.ts: public surface.

Regenerates lib/api/generated/schema.d.ts from the v2 backend so the bounty
draft paths/DTOs are present.
Adds the bounty Configure wizard orchestrator and its step + draft state,
mirroring the hackathon wizard. No AI assist.

- components/organization/bounties/new/constants.ts: StepKey
  (scope/mode/submission/reward/review), STEP_ORDER, BountyFormData, and
  isBountyStepDataValid.
- hooks/use-bounty-steps.ts: URL ?step= navigation (free-roam) with a
  presentational step-status map.
- hooks/use-bounty-draft.ts: lazy create (ensureDraftId) then per-section PATCH,
  resume via useDraft, and transformBountyFromApi (sections -> form state;
  winnerCount derived from prize tiers, ISO dates trimmed for the inputs).
- components/organization/bounties/new/NewBountyTab.tsx: orchestrator wiring
  steps + draft + per-step save, persisting ?draftId= for resume, and threading
  the chosen mode from ModeTab into SubmissionModelTab.

Scope/Reward/Review tabs (boundlessfi#600) and the publish + funding flow (boundlessfi#601) are left
as marked placeholders with their save/navigate/draftId seams in place; this
satisfies the acceptance criteria (navigate, autosave, resume) without
speculative publish UI that depends on the unbuilt publish hook.
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

@Benjtalkshow 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 Jun 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f62c5be7-6ba9-4d9d-be1f-d0036b0c63dc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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.

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.

1 participant