Skip to content

feat: add inline actions into workspaces table #17636

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

BrunoQuaresma
Copy link
Collaborator

No description provided.

@BrunoQuaresma BrunoQuaresma requested a review from Copilot May 1, 2025 16:56
Copy link
Contributor

@Copilot Copilot AI 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

This PR introduces inline actions to the workspaces table while refactoring how workspace data is queried and updated. Key changes include:

  • Refactoring the useWorkspacesData hook to accept a WorkspacesRequest object and updating query keys.
  • Implementing a new WorkspaceActionsCell with inline action buttons and associated success/error callbacks.
  • Removing redundant isOwner props by computing ownership via the authenticated user, and updating related update/cancellation hooks.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
site/src/pages/WorkspacesPage/data.ts Refactors workspace data fetching to use WorkspacesRequest and updates the queryKey handling.
site/src/pages/WorkspacesPage/WorkspacesTable.tsx Introduces the WorkspaceActionsCell component and updates table cell layout.
site/src/pages/WorkspacesPage/WorkspacesPageView.tsx Passes inline action callbacks to the table component.
site/src/pages/WorkspacesPage/WorkspacesPage.tsx Updates query parameter naming and adds action success/error callbacks.
site/src/pages/WorkspacePage/WorkspaceTopbar.tsx Removes the isOwner prop; ownership is now derived via authentication.
site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx Switches to the new workspace update hook and renders WorkspaceUpdateDialogs.
site/src/pages/WorkspacePage/WorkspaceActions/WorkspaceActions.tsx Refactors cancel button logic by computing isOwner locally and replacing the showCancel variable.
site/src/pages/WorkspacePage/WorkspaceActions/WorkspaceActions.stories.tsx Adds an auth provider for story consistency.
site/src/modules/workspaces/useWorkspaceUpdate.tsx Implements a new hook for workspace update flows with confirmation/missing parameter dialogs.
site/src/modules/workspaces/actions.ts Adjusts abilities logic to take a permissions object instead of a boolean for canDebug.
site/src/hooks/usePagination.ts Replaces manual offset calculation with the calcOffset helper function.
site/src/components/Dialogs/Dialog.tsx Adds stopPropagation logic to cancel button clicks to avoid undesired events.
site/src/api/queries/workspaces.ts Updates queryFn to pass full request config to the API.
Comments suppressed due to low confidence (2)

site/src/pages/WorkspacePage/WorkspaceTopbar.tsx:55

  • [nitpick] Since the isOwner prop is removed and ownership is now derived from the authenticated user, ensure that all child components relying on 'isOwner' are updated accordingly to prevent any unexpected UI behavior.
 // Removed: isOwner prop

site/src/pages/WorkspacePage/WorkspaceActions/WorkspaceActions.tsx:174

  • [nitpick] Replacing the 'showCancel' condition with 'canCancel' changes the criteria for displaying the CancelButton; please verify that this aligns with the intended cancellation permissions and workspace state logic.
{canCancel && <CancelButton handleAction={handleCancel} />}

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.

1 participant