📌 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
🔒 Security notes
No new attack surface; a client-side UI consistency fix.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 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"}, andMetricsBar's refresh button swaps to aSpinnerwhile refreshing.AnchorForm's andSettlementForm's submit buttons (src/components/AnchorForm.tsx,src/components/SettlementForm.tsx), by contrast, only getdisabled={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 byQuoteFormand the panels' other async buttons.🧩 Requirements and context
AnchorForm's andSettlementForm's submit buttons should show pending-state text feedback (e.g. "Registering…" / "Opening…"), consistent withQuoteForm's "Quoting…" andSettlementsPanel's "Exporting…" conventions.disabled={pending}behavior must be unchanged.🛠️ Suggested execution
src/components/AnchorForm.tsxandsrc/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 existingdisabled={pending}.src/components/AnchorForm.test.tsxandsrc/components/SettlementForm.test.tsxwith a test asserting the button's text changes whilependingistrueand reverts once it'sfalse.✅ Acceptance criteria
disabledbehavior is unchanged.🔒 Security notes
No new attack surface; a client-side UI consistency fix.
📋 Guidelines