Skip to content

Add workspace-admin remove-from-workspace row action to the Teams page - #13

Open
warp-agent-staging[bot] wants to merge 1 commit into
base/pinned-checkoutfrom
factory/workspace-remove-row-action
Open

warp-agent-staging[bot] wants to merge 1 commit into
base/pinned-checkoutfrom
factory/workspace-remove-row-action

Conversation

@warp-agent-staging

@warp-agent-staging warp-agent-staging Bot commented Sep 16, 2026

Copy link
Copy Markdown

Companion PR: warp-server web admin half — https://github.com/warpdotdev/warp-server-for-benchmarks/pull/760

Description

Adds a Remove from workspace row action for workspace administrators on the Teams page (TeamsPageView::team_to_item_list). On a native workspace, the action removes the member from the workspace and all of its teams via the server's existing removeUserFromWorkspace mutation, called with entrypoint: TeamSettings to match remove-from-team. No new backend operation.

The action appears on a member row only when all of these hold (identical gating matrix on both surfaces of the paired feature):

  • the workspace is a native workspace,
  • the viewer is a workspace administrator or workspace owner,
  • the row is not the viewer's own row,
  • the target member is not the workspace owner.

Consequences pinned by tests: a team-only administrator (team admin with no workspace-admin role) never sees it — the gating reads workspace.is_workspace_admin directly rather than the has_admin_permissions helper, which is true for team admins too; on a non-native workspace the action is absent entirely, so no duplicate remove actions appear; and the existing team-owner protection on Remove from team is unchanged.

Confirmation copy (member email and workspace name interpolated):

  • Remove from workspace — title Remove from workspace?, confirm button Remove from workspace: "Are you sure you want to remove {email} from the workspace? This will remove {email} from all teams in {workspaceName} and from the workspace itself."
  • Remove from team on a native workspace — title Remove from team?, confirm button Remove from team: "Are you sure you want to remove {email} from this team? {email} will still keep their {workspaceName} workspace membership and their other team memberships." No reload-credit copy.
  • Remove from team on a legacy (non-native) workspace — unchanged, including the existing reload-credits warning.

New dialog variants (RemoveUserFromWorkspace, RemoveUserFromNativeWorkspaceTeam) follow the LeaveNativeWorkspaceTeam precedent in CloudActionConfirmationDialog. WorkspaceMembersSettings is untouched.

Linked Issue

No linked issue; this is a factory task paired with the same feature on the web admin Teams page in warp-server.

Based on the pinned checkout, so the base branch is base/pinned-checkout (the mirror's master predates the pin and would show ~93 files of unrelated history).

Testing

  • I have manually tested my changes locally with ./script/run — not applicable: this task explicitly declined computer interaction; verification is by automated tests and builds below.

New focused tests:

  • teams_page_tests.rs: gating matrix via the existing team_to_item_list table — workspace admin gets the action, team-only admin does not, workspace owner's row is protected, non-native workspace shows no workspace action (existing tests updated for the new action in native cases), plus the viewer's-own-row rule already covered.
  • cloud_action_confirmation_dialog_tests.rs: exact title/body/button for both new variants.
  • user_workspaces_tests.rs: remove_user_from_workspace forwards user_uid, workspace_uid, and CloudObjectEventEntrypoint::TeamSettings to the workspace client (mockall withf) and emits RemoveUserFromWorkspaceSuccess.

Commands run and results:

  • cargo check -p warp_graphql — pass (also validates the new cynic mutation against the updated schema snapshot)
  • cargo check -p warp --tests — pass
  • cargo nextest run -p warp -E 'test(teams_page) or test(cloud_action_confirmation_dialog) or test(remove_user_from_workspace)' — 36 run, 36 passed
  • ./script/format — run
  • cargo clippy -p warp_graphql -p warp --tests -- -D warnings — pass

Screenshots / Videos

None; computer interaction was declined for this task.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Workspace administrators on native workspaces get a Remove-from-workspace
action on member rows (except their own row and the workspace owner's row);
it calls the server's existing removeUserFromWorkspace mutation with the
TeamSettings entrypoint. Team-only admins never see it, and non-native
workspaces show no new action, so no duplicate remove actions appear.
Remove-from-team on a native workspace now uses member-personalized copy
with no reload-credits warning; legacy workspaces keep the existing
billing warning.
@warp-agent-staging

Copy link
Copy Markdown
Author
View run View conversation
This PR was generated with [Warp](https://warp.dev/factories).

Comment @warp-staging-factory on this PR to send it follow-up work.

@warp-agent-staging
warp-agent-staging Bot changed the base branch from master to base/pinned-checkout September 16, 2026 23:02
@warp-agent-staging
warp-agent-staging Bot marked this pull request as ready for review September 17, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants