Skip to content

[scanner] fix: add loading states to async button handlers - #21295

Merged
clubanderson merged 2 commits into
mainfrom
scanner/fix-21293
Jul 19, 2026
Merged

[scanner] fix: add loading states to async button handlers#21295
clubanderson merged 2 commits into
mainfrom
scanner/fix-21293

Conversation

@clubanderson

Copy link
Copy Markdown
Collaborator

Fixes #21293

Changes

Add missing isLoading/disabled states to three async button handlers that lacked visual feedback during in-flight operations:

NamespaceAccessPanel — revoke access button

  • Add revokingBindingName state (per-entry) to handleRevokeAccess
  • Disable the revoke button and show a Loader2 spinner while the DELETE rolebinding call is in flight
  • Prevents double-submission on the RBAC revoke action

UserManagementModal — delete user confirmation

  • Change onConfirm type to (userId: string) => Promise<void>
  • Add isDeleting state; pass isLoading={isDeleting} to ConfirmDialog
  • Confirm button is now disabled while the async delete resolves

UserManagementList + UserManagement.types

  • Update onDeleteUser type to Promise<void> to match the async handleDeleteUser implementation
  • Remove premature setDeleteConfirmUserId(null) so the modal stays open until the operation completes

- NamespaceAccessPanel: add per-entry revokingBindingName state to
  handleRevokeAccess; disable and show spinner on revoke button during
  the DELETE rolebinding call to prevent double-submission
- UserManagementModal: change DeleteUserConfirmModal.onConfirm type to
  Promise<void>, add isDeleting state, pass isLoading to ConfirmDialog
  so the confirm button is disabled while the delete is in flight
- UserManagementList: remove premature setDeleteConfirmUserId(null) so
  the modal stays open until the async delete resolves/rejects
- UserManagement.types: update onDeleteUser signature to Promise<void>

Fixes #21293

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Scanner <scanner@kubestellar.io>
Copilot AI review requested due to automatic review settings July 19, 2026 20:05
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jul 19, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mikespreitzer for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Jul 19, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit 8aaa518
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a5d39dacf9d34000822436d
😎 Deploy Preview https://deploy-preview-21295.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @clubanderson — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🐝 Hi @clubanderson! I'm kubestellar-hive[bot], an automation bot for this repo.

Trusted users — org members and contributors with write access — can mention @kubestellar-hive in a comment to trigger repo automation.
On issues, that mention queues an automated fix attempt. On pull requests, it records extra context for existing automation.
This is not an interactive Q&A bot, so mentions should be treated as requests for automation rather than a conversation.

Automation may take a moment to start, and follow-up happens through workflow activity rather than chat replies.

@github-actions github-actions Bot added the ai-generated Pull request generated by AI label Jul 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Test Coverage Check

All new source files in this PR have corresponding test files.

Checked web/src/hooks/ and web/src/components/ against origin/main.

@github-actions

Copy link
Copy Markdown
Contributor

Auto Test Generator

The following new files have no corresponding test file:

  • web/src/components/cards/UserManagement.types.ts
  • web/src/components/cards/UserManagementList.tsx
  • web/src/components/cards/UserManagementModal.tsx

Please add tests or apply the needs-tests label to track this PR.

@github-actions

Copy link
Copy Markdown
Contributor

♿ Accessibility Audit (WCAG 2.1 AA)

✅ No WCAG 2.1 AA violations detected in audited routes.


Powered by axe-core. Target: WCAG 2.1 AA compliance.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds in-flight UX feedback (loading + disabled states) for destructive async actions so users get clear progress indication and double-submissions are avoided across namespace access revocation and console user deletion flows.

Changes:

  • NamespaceAccessPanel: disables the revoke button and shows a spinner while the DELETE rolebinding request is in flight.
  • UserManagementModal/UserManagementList: makes delete confirmation async-aware and wires isLoading through ConfirmDialog to disable buttons during deletion.
  • Updates onDeleteUser typing to return Promise<void> to match the async delete implementation.

Note: build/lint are validated by CI on the PR (per AGENTS.md).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
web/src/components/namespaces/NamespaceAccessPanel.tsx Adds revoke-button loading/disabled state while RBAC revocation runs.
web/src/components/cards/UserManagementModal.tsx Adds isDeleting state and passes isLoading to ConfirmDialog while awaiting async confirm.
web/src/components/cards/UserManagementList.tsx Keeps delete confirm modal open until the async delete finishes by awaiting onConfirm.
web/src/components/cards/UserManagement.types.ts Updates onDeleteUser to return Promise<void> to reflect async behavior.

Comment on lines +53 to 55
setRevokingBindingName(binding.bindingName)
try {
const params = new URLSearchParams({
Comment on lines 49 to 50
if (!window.confirm(`Revoke access for ${binding.subjectName}?`)) {
return
Comment on lines 69 to 70
console.error('Failed to revoke access:', err)
showToast('Failed to revoke access', 'error')
@clubanderson
clubanderson merged commit 0bc9e56 into main Jul 19, 2026
30 of 33 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-21293 branch July 19, 2026 20:56
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions

Copy link
Copy Markdown
Contributor

Post-merge build verification passed

Both Go and frontend builds compiled successfully against merge commit 0bc9e56a0aea513065512b8b64b5997ae7277701.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: 0bc9e56a0aea513065512b8b64b5997ae7277701
Specs run: Dashboard.spec.ts NamespaceOverview.spec.ts smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/29703441527

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

Labels

ai-generated Pull request generated by AI dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tier/2-standard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Auto-QA] Missing loading states on async actions

2 participants