Skip to content

Build invoice duplicate/clone UI with pre-fill, field validation, conflict detection, and optimistic feedback #194

@Kingsman-99

Description

@Kingsman-99

Description

Build a full duplicate/clone flow for invoices: a Duplicate button on the detail page, navigation to a pre-filled create form, field-level validation showing what changed vs the original, detection of conflicting deadlines, and optimistic UI feedback while the clone transaction is in-flight.

Acceptance Criteria

  • A Duplicate button appears on /invoice/[id] only for the invoice creator (hide for all other wallets)
  • Clicking opens a modal asking for a new deadline before navigating — do not navigate with stale deadline
  • On confirm, navigates to /invoice/new with all original fields pre-populated via URL state or query params (recipients, amounts, token, options)
  • Create form shows a Cloned from #ID banner linking back to the original
  • Fields that differ from the original are highlighted with a yellow border and tooltip "Changed from original"
  • If the new deadline is before now + 1 hour, form shows inline error "Deadline must be at least 1 hour in the future" and blocks submission
  • On submit, calls cloneInvoice SDK method; button shows spinner and "Cloning..." text during submission
  • On success, shows toast "Invoice #NEW_ID created" and navigates to /invoice/NEW_ID
  • On failure, shows error toast with the contract error message and keeps form state intact
  • Unit test for the deadline validation logic; integration test for the pre-fill URL parsing

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgrantfoxIssue for GrantFox program

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions