Add a duplicate-from-existing-commitment prefill action to the create flow#1193
Open
greatest0fallt1me wants to merge 1 commit into
Open
Add a duplicate-from-existing-commitment prefill action to the create flow#1193greatest0fallt1me wants to merge 1 commit into
greatest0fallt1me wants to merge 1 commit into
Conversation
…create flow - Add `usePrefillFromCommitment` hook that reads `?sourceId` from the URL, fetches the source commitment's configurable parameters, and returns a typed `PrefillData` object (identity-bound fields excluded). - Add `onDuplicate` prop to `CommitmentDetailActions` with a Duplicate button that routes to `/create?sourceId=<id>`. - Update `CreateCommitment` page to apply prefill on mount (skips step 1, prefills step 2) and show an accessible status banner in duplicate mode. - Add `DuplicateCommitment.test.tsx` covering hook happy path, missing source, identity-field exclusion, clamping, and UI integration. - Add `docs/DUPLICATE_COMMITMENT.md` with API, accessibility, usage, and edge-case docs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@greatest0fallt1me is attempting to deploy a commit to the 1nonly's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #952
Summary
usePrefillFromCommitmenthook: reads?sourceIdquery param, fetches the source commitment's configurable parameters, and returns a typedPrefillDataobject (identity-bound fieldsid,ownerAddress, on-chain state are intentionally excluded).onDuplicateprop toCommitmentDetailActionswith a Duplicate Commitment button that routes to/create?sourceId=<id>.CreateCommitmentpage to apply prefill on mount (skips type-selection step 1, opens step 2 pre-filled) and shows an accessiblerole="status"banner informing the user they are in duplicate mode.Changes
src/hooks/usePrefillFromCommitment.ts— new hook with safe fallback for missing/erroring sourcessrc/components/CommitmentDetailActions.tsx— new optionalonDuplicateprop + Duplicate buttonsrc/app/create/page.tsx— prefill integration, duplicate-mode bannersrc/app/create/DuplicateCommitment.test.tsx— tests covering happy path, 404, network error, identity-field exclusion, clamping, and page-level integrationdocs/DUPLICATE_COMMITMENT.md— feature docs with API, accessibility notes, usage example, and edge-case table