Skip to content

Replace the New Service Saving… text button with the loading-aware Button primitive #151

Description

@mikewheeleer

Adopt the loading-aware Button on the New Service submit

Description

src/app/services/new/page.tsx renders a bespoke <button> that swaps its label to "Saving…" and toggles disabled while submitting, duplicating logic the shared Button (with its loading/aria-busy support) is meant to own. This issue swaps the inline button for the primitive so the busy state is announced to assistive tech and the markup is consistent with other forms.

Requirements and context

  • Repository scope: Agentpay-Org/Agentpay-frontend only.
  • Replace the inline submit <button> with Button using its loading prop bound to the page's loading state.
  • Keep type="submit" so the form still submits, and preserve the disabled-while-saving behaviour.
  • Do not change the validation or the router.push("/services") success path.
  • Coordinate with the New Service TextField migration if both land; this issue only touches the submit control.

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b enhancement/services-new-loading-button
  • Implement changes
  • Test and commit

Test and commit

  • Run npm run lint, npm run typecheck, npm test, and npm run build.
  • Cover edge cases: submit then error (button re-enables), double-click blocked, and success navigation.
  • Include the npm test output.

Example commit message

feat(services): use the loading-aware Button on the New Service form

Guidelines

  • Minimum 95 percent test coverage for the changed page.
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the AgentPay community on Discord for questions, reviews, and faster merges: https://discord.gg/eXvRKkgcv
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions