Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add stop workspace button with confirmation dialog#18372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
blink-so wants to merge6 commits intomain
base:main
Choose a base branch
Loading
fromfeat/stop-workspace-button

Conversation

blink-so[bot]
Copy link
Contributor

Summary

Adds a stop workspace button with confirmation dialog to complement the existing start button, addressing the feature request in#18298.

Changes

  • Stop Button: Added a stop workspace button with square icon that replaces the start button for running workspaces
  • Confirmation Dialog: Implemented confirmation dialog to prevent accidental workspace stops
  • State Management: Button visibility is controlled by existing workspace status logic
  • API Integration: Uses existingstopWorkspace API mutation
  • UI Consistency: Follows established patterns for workspace action buttons

Behavior

  • Stopped workspaces: Show start button (play icon)
  • Running workspaces: Show stop button (square icon)
  • Stop action: Triggers confirmation dialog before executing
  • Loading states: Button shows spinner during stop operation

Testing

  • Code passes biome quality checks
  • Follows existing TypeScript patterns
  • Uses established component patterns from the codebase

Fixes#18298

- Add stop workspace button with square icon that replaces start button for running workspaces- Implement confirmation dialog for stop operation to prevent accidental stops- Button shows only when workspace status allows stop action- Uses existing stopWorkspace API mutation- Follows existing UI patterns for workspace actionsFixes#18298Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a stop workspace button with a confirmation dialog to complement the existing start button and prevent accidental stops.

  • Introduces a stop action button (square icon) shown for running workspaces.
  • Implements a confirmation dialog that prompts before calling thestopWorkspace mutation.
  • Leverages existing API mutation and workspace status logic for visibility and loading indicators.
Comments suppressed due to low confidence (1)

site/src/pages/WorkspacesPage/WorkspacesTable.tsx:594

  • Add tests to cover the stop workspace confirmation dialog: verify it opens on button click, displays the correct workspace name, and invokes thestopWorkspace mutation on confirm.
<ConfirmDialog

@matifalimatifali marked this pull request as draftJune 13, 2025 20:11
blink-sobotand others added2 commitsJune 13, 2025 20:13
- Add disabled prop to PrimaryActionProps interface- Implement disabled state in PrimaryAction component- Apply disabled prop to stop button when stopWorkspaceMutation is pending- Prevents accidental duplicate stop requests during operationCo-authored-by: matifali <10648092+matifali@users.noreply.github.com>
- ConfirmDialog component doesn't accept loading prop- Fixes TypeScript compilation error in CI- Button disabled state still prevents duplicate clicksCo-authored-by: matifali <10648092+matifali@users.noreply.github.com>
@matifalimatifali marked this pull request as ready for reviewJune 13, 2025 20:29
@BrunoQuaresma
Copy link
Collaborator

@matifali I'm in a rush with the website right now, so I will not have time this weeek to QA and review this PR. Maybe someone in the FE guild, can help with that in the meantime.

blink-so[bot] reacted with thumbs up emoji

@BrunoQuaresmaBrunoQuaresma removed their request for reviewJune 16, 2025 12:39
@matifalimatifali requested review froma team andcode-asher and removed request fora teamJune 16, 2025 15:24
Copy link
Member

@code-ashercode-asher left a comment

Choose a reason for hiding this comment

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

Works, but we should remove thedisabled prop and just useisLoading for disablement.

Technically it might not even be necessary as a state change removes the button, but there could be some latency where the workspace is stoping and the state has not updated on the frontend yet.

Use isLoading for button disabling instead of separate disabled prop.This simplifies the component interface while maintaining the samefunctionality - the button is disabled when loading.Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
@code-asher
Copy link
Member

code-asher commentedJun 16, 2025
edited
Loading

Also@matifali just to check, we have no confirmation dialog for stopping on the main workspace page (or any other actions on this table), just confirming that it was intended we add one here.

blink-so[bot] reacted with thumbs up emoji

@blink-soblink.so
Copy link
ContributorAuthor

Good point about consistency! You're right that other actions on this page don't have confirmation dialogs.

Looking at the original feature request in#18298, it specifically mentioned wanting a confirmation dialog to prevent accidental stops. However, for consistency with the rest of the workspaces table actions, we could remove the confirmation dialog.

Would you prefer I remove the confirmation dialog to match the existing pattern, or keep it since stopping a workspace is a more disruptive action than starting one?

blink-so[bot] reacted with thumbs up emoji

Remove empty line left after removing disabled prop to satisfybiome formatter requirements.Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
@matifali
Copy link
Member

This is a more accessible button, so IMO, there is a greater chance of hitting stop by accident, which is why I added the confirmation dialogue.

blink-so[bot] and code-asher reacted with thumbs up emojiblink-so[bot] reacted with heart emoji

Remove the disabled prop from PrimaryActionProps interface andcomponent implementation since we now only use isLoading forbutton disabling.Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
Copy link
Member

@code-ashercode-asher left a comment
edited
Loading

Choose a reason for hiding this comment

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

Makes sense, also I was wrong about there being no dialogs on this table, the update action does have a confirmation prompt.

Looks good!

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

Copilot code reviewCopilotCopilot left review comments

@code-ashercode-ashercode-asher approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

feat: stop workspace button
3 participants
@BrunoQuaresma@code-asher@matifali

[8]ページ先頭

©2009-2025 Movatter.jp