Skip to content

Support isBusy for Dialog and CommandDialog#21

Merged
einari merged 3 commits intomainfrom
copilot/add-isbusy-support-for-dialog
Mar 3, 2026
Merged

Support isBusy for Dialog and CommandDialog#21
einari merged 3 commits intomainfrom
copilot/add-isbusy-support-for-dialog

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 3, 2026

Adds a busy state to Dialog that disables all buttons and shows a loading spinner on the primary action button. CommandDialog automatically manages this state during command execution.

Added

  • isBusy?: boolean prop on Dialog — when true, disables all footer buttons and renders a loading spinner on the primary (Ok/Yes) button via PrimeReact's Button.loading
  • Automatic isBusy management in CommandDialog: set to true before command execution, reset to false in a finally block to ensure cleanup even on error
  • IsBusy Storybook story for Dialog demonstrating a 3-second simulated save with spinner and disabled buttons
  • WithBusyState Storybook story for CommandDialog using DemoSlowUpdateUserCommand (overrides execute() with a 2-second delay) to show the automatic busy state in action
  • Spec for_Dialog/when_rendered_with_is_busy verifying all buttons are disabled when isBusy=true
  • Spec for_CommandDialog/when_not_executing verifying the dialog is not in a busy state on initial render
  • Documentation for the isBusy prop in Documentation/Dialogs/dialog.md and a new Busy State section in Documentation/CommandDialog/index.md
Original prompt

This section details on the original issue you should resolve

<issue_title>Support isBusy for Dialog</issue_title>
<issue_description>Let's add a property for Dialog that will then add a spinner for the primary button when it is true instead of the text.
All buttons in the dialog should become disabled when isBusy is true.

The CommandDialog should set isBusy to true when executing a command and when it is completed set it to false.

</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: einari <134365+einari@users.noreply.github.com>
Copilot AI changed the title [WIP] Add isBusy support for Dialog component Support isBusy for Dialog and CommandDialog Mar 3, 2026
@einari
Copy link
Copy Markdown
Contributor

einari commented Mar 3, 2026

@copilot Add Storybook stories for both components, the CommandDialog should then just have a Command that overrides the execute method and adds a delay - just to show how it works. Also update documentation and write specs for this functionality.

Co-authored-by: einari <134365+einari@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot Add Storybook stories for both components, the CommandDialog should then just have a Command that overrides the execute method and adds a delay - just to show how it works. ...

Done in commit a0e0139. Here's what was added:

Storybook stories:

  • DialogIsBusy story: opens a dialog where clicking Ok triggers a 3-second async save — all buttons disable and the primary button shows PrimeReact's loading spinner while it runs
  • CommandDialogWithBusyState story: uses DemoSlowUpdateUserCommand which overrides execute() with a 2-second delay, demonstrating the automatic busy state management built into CommandDialog

Specs:

  • Dialogs/for_Dialog/when_rendered_with_is_busy.ts: verifies all buttons are disabled when isBusy=true
  • CommandDialog/for_CommandDialog/when_not_executing.ts: verifies the dialog is not in a busy state on initial render

Documentation:

  • Documentation/Dialogs/dialog.md: added isBusy prop entry
  • Documentation/CommandDialog/index.md: added "Busy state management" to Key Features and a new Busy State section explaining the automatic behavior

@einari einari added the minor label Mar 3, 2026
@einari einari marked this pull request as ready for review March 3, 2026 10:54
@einari einari merged commit 4e65de1 into main Mar 3, 2026
@einari einari deleted the copilot/add-isbusy-support-for-dialog branch March 3, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support isBusy for Dialog

2 participants