feat(bounty): wizard shell + step/draft machinery (#598)#613
feat(bounty): wizard shell + step/draft machinery (#598)#613Benjtalkshow wants to merge 2 commits into
Conversation
…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.
|
@Benjtalkshow is attempting to deploy a commit to the Threadflow Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Closes #598. Part of the Bounty Configure (Host a Bounty) frontend epic (#603).
What
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,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 viauseDraft, andtransformBountyFromApi(sections → form state;winnerCountderived 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
useBountySteps(?step=, back/forward/bookmark safe).createSaveHandler→saveStep→ PATCH, for the live ModeTab + SubmissionModelTab.useBountyDraftresume +onDraftLoadedrebuilds 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-publishhook (#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:TODO(#600)) and a disabled "Publish (coming in FE: use-bounty-publish (escrow publish via shared runner) #601)" + a working "Save draft" on the Review step (TODO(#601)).draftIdseam in place, so FE: Scope + Reward + Review tabs and Zod schemas #600 drops in the three tabs (onSave={createSaveHandler(...)}) and FE: use-bounty-publish (escrow publish via shared runner) #601 drops in the publish hook + modals with minimal change.This fully satisfies #598's acceptance criteria (navigate / autosave / resume) while keeping publish/funding in its natural home (#601).