Skip to content

feat(ux): add processing/loading state to BillingProfileCard (#273)#370

Closed
jd5073356-max wants to merge 1 commit into
Grainlify:mainfrom
jd5073356-max:ux/billingprofilecard-loading
Closed

feat(ux): add processing/loading state to BillingProfileCard (#273)#370
jd5073356-max wants to merge 1 commit into
Grainlify:mainfrom
jd5073356-max:ux/billingprofilecard-loading

Conversation

@jd5073356-max

Copy link
Copy Markdown

Closes #273

What

BillingProfileCard (src/features/settings/components/billing/BillingProfileCard.tsx) invoked its click handler with no in-card feedback, so while an action was processing the card looked idle and could be clicked repeatedly.

Changes

  • New optional prop isProcessing?: boolean (default false, documented with TSDoc).
  • While processing the card:
    • shows a Loader2 spinner (role="status", aria-label="Processing"), matching the existing spinner pattern in ApplicationCard.tsx;
    • is marked aria-busy;
    • is visually disabled (opacity-60, pointer-events-none, cursor-default) with hover affordances removed;
    • guards its click handler so the action cannot be triggered twice.
  • Normal interactive state is restored when isProcessing returns to false.
  • The colorblind-safe status badges are unchanged.

BillingTab is untouched — the prop is optional and backward compatible.

Tests

New BillingProfileCard.test.tsx: normal click works; processing shows the spinner + aria-busy and blocks duplicate activation; state restores after processing; plus status-badge, type-label and dark-theme coverage.

Verification

  • npm run typecheck — passes.
  • BillingProfileCard.test.tsx — 7/7 pass. Coverage of the file: 100% lines / 100% statements / 100% functions.
  • Genuineness: reverting the component change makes the new tests fail.

Security

None.

…fy#273)

BillingProfileCard had no in-card feedback while an action was processing,
so the card looked idle and could be clicked repeatedly.

- Add an optional `isProcessing` prop (default false).
- While processing: show a Loader2 spinner, set `aria-busy`, dim and disable
  the card (pointer-events-none), and guard the click handler so the action
  cannot be triggered twice.
- Restore the normal interactive state when processing completes.
- Keep the colorblind-safe status badges intact.

Adds BillingProfileCard.test.tsx covering normal/processing states, duplicate
activation prevention, status badges, type label and dark theme.

Closes Grainlify#273
@Jagadeeshftw

Copy link
Copy Markdown
Contributor

hey @jd5073356-max, thanks for jumping in! closing this pr because the author needs to be assigned to the linked issue (#273) before opening a pr. please comment on the issue requesting assignment, wait to be assigned, then re-raise your pr. this keeps work fairly distributed across contributors. hope to see a revised pr from you soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make BillingProfileCard show a loading state while a profile action is processing

2 participants