Skip to content

AnchorForm's and SettlementForm's submit buttons show no pending-state text feedback, unlike QuoteForm #325

Description

@Jagadeeshftw

📌 Description

QuoteForm's submit button (src/components/QuoteForm.tsx) shows {result.status === "loading" ? "Quoting…" : "Get quote"} — its label changes to make the in-flight state obvious. SettlementsPanel's "Export CSV" button similarly shows {exporting ? "Exporting…" : "Export CSV"}, and MetricsBar's refresh button swaps to a Spinner while refreshing. AnchorForm's and SettlementForm's submit buttons (src/components/AnchorForm.tsx, src/components/SettlementForm.tsx), by contrast, only get disabled={pending} — the label stays "Register" / "Open settlement" the entire time, with no text or spinner change to indicate a request is actually in flight. A user clicking either button during a slow network request sees it go inert with no visual cue as to why, unlike the consistent "verb + …" pattern already established by QuoteForm and the panels' other async buttons.

🧩 Requirements and context

  • AnchorForm's and SettlementForm's submit buttons should show pending-state text feedback (e.g. "Registering…" / "Opening…"), consistent with QuoteForm's "Quoting…" and SettlementsPanel's "Exporting…" conventions.
  • The existing disabled={pending} behavior must be unchanged.
  • No change to the Reset button's separate, already-tracked pending-disabled behavior.

🛠️ Suggested execution

  • In src/components/AnchorForm.tsx and src/components/SettlementForm.tsx, change the submit button's label to conditionally show a pending-state string (e.g. {pending ? "Registering…" : "Register"} / {pending ? "Opening…" : "Open settlement"}) alongside the existing disabled={pending}.
  • Extend src/components/AnchorForm.test.tsx and src/components/SettlementForm.test.tsx with a test asserting the button's text changes while pending is true and reverts once it's false.

✅ Acceptance criteria

  • AnchorForm's and SettlementForm's submit buttons show distinct pending-state text.
  • Existing disabled behavior is unchanged.
  • Test coverage for the pending-state label in both forms.

🔒 Security notes

No new attack surface; a client-side UI consistency fix.

📋 Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26frontendFrontend / UI workui-uxUI/UX design task

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions