Description
The streams list advertises a "Create Stream" / "Create Your First Stream" call to action in app/streams/StreamsPageContent.tsx, but no creation UI exists — the buttons lead nowhere and the page renders only mockStreams. Meanwhile the backend is ready: POST /api/v2/streams (app/api/v2/streams/route.ts) accepts { recipient, rate, schedule, token }, runs shared field validation through validateCreateStreamBody (app/lib/stream-validation.ts), and returns the v2 stream shape on 201. This issue adds a client form that collects those fields, mirrors the server validation rules, and submits via the existing idempotent API client.
Requirements and context
- Add a stream-creation form (e.g.
app/streams/new/page.tsx plus a StreamForm component) with fields for recipient, rate, schedule, and optional token.
- Submit using
fetchWithIdempotency from lib/apiClient.ts (it already injects the Idempotency-Key header for mutating requests) to POST /api/v2/streams.
- Client-side validation must mirror
validateCreateStreamBody: required recipient validated as a Stellar public key, rate a positive decimal with at most 7 decimal places, and schedule one of SUPPORTED_SCHEDULES (second…year).
- Render the field-level
422 VALIDATION_ERROR details[] returned by the route next to the corresponding inputs, and surface non-422 failures via the existing ErrorToast/ErrorBanner components.
- Non-functional: disable submit while in flight, show a busy state, and on
201 route the user to the created stream's detail page.
Acceptance criteria
Suggested execution
1. Fork the repo and create a branch — git checkout -b feature/stream-creation-form.
2. Implement changes — add app/streams/new/page.tsx and a StreamForm component under app/components/, importing SUPPORTED_SCHEDULES from app/lib/stream-validation.ts and isValidStellarPublicKey from app/lib/wallet-link.ts.
3. Write/extend tests — add a StreamForm.test.tsx next to the component (Jest + Testing Library, mocking fetchWithIdempotency), following the harness style in app/streams/page.test.tsx and app/components/Modal.test.tsx.
4. Test and commit —
npm test
npm run lint
npm run build
Example commit message
feat(streams): add stream-creation form wired to POST /api/v2/streams
Guidelines
Touched modules must reach >=90% line coverage. All inputs need associated <label>s and aria-describedby error wiring, and the README route table / openapi.json create flow should be referenced in the component docs. Timeframe: 96 hours.
Description
The streams list advertises a "Create Stream" / "Create Your First Stream" call to action in
app/streams/StreamsPageContent.tsx, but no creation UI exists — the buttons lead nowhere and the page renders onlymockStreams. Meanwhile the backend is ready:POST /api/v2/streams(app/api/v2/streams/route.ts) accepts{ recipient, rate, schedule, token }, runs shared field validation throughvalidateCreateStreamBody(app/lib/stream-validation.ts), and returns the v2 stream shape on201. This issue adds a client form that collects those fields, mirrors the server validation rules, and submits via the existing idempotent API client.Requirements and context
app/streams/new/page.tsxplus aStreamFormcomponent) with fields forrecipient,rate,schedule, and optionaltoken.fetchWithIdempotencyfromlib/apiClient.ts(it already injects theIdempotency-Keyheader for mutating requests) toPOST /api/v2/streams.validateCreateStreamBody: requiredrecipientvalidated as a Stellar public key,ratea positive decimal with at most 7 decimal places, andscheduleone ofSUPPORTED_SCHEDULES(second…year).422 VALIDATION_ERRORdetails[]returned by the route next to the corresponding inputs, and surface non-422 failures via the existingErrorToast/ErrorBannercomponents.201route the user to the created stream's detail page.Acceptance criteria
recipient,rate,schedule, and optionaltokenand posts to/api/v2/streamsviafetchWithIdempotency.validateCreateStreamBodyrules (public-key recipient, positive 7-dp rate, allowed schedule).422field errors map to the right inputs; other errors render throughErrorToast/ErrorBanner.StreamsPageContentnavigate to the form.Suggested execution
1. Fork the repo and create a branch —
git checkout -b feature/stream-creation-form.2. Implement changes — add
app/streams/new/page.tsxand aStreamFormcomponent underapp/components/, importingSUPPORTED_SCHEDULESfromapp/lib/stream-validation.tsandisValidStellarPublicKeyfromapp/lib/wallet-link.ts.3. Write/extend tests — add a
StreamForm.test.tsxnext to the component (Jest + Testing Library, mockingfetchWithIdempotency), following the harness style inapp/streams/page.test.tsxandapp/components/Modal.test.tsx.4. Test and commit —
npm test npm run lint npm run buildExample commit message
Guidelines
Touched modules must reach >=90% line coverage. All inputs need associated
<label>s andaria-describedbyerror wiring, and the README route table /openapi.jsoncreate flow should be referenced in the component docs. Timeframe: 96 hours.