Gray out disabled team and workspace members in Settings - #15258
Draft
warp-agent-staging[bot] wants to merge 3 commits into
Draft
Gray out disabled team and workspace members in Settings#15258warp-agent-staging[bot] wants to merge 3 commits into
warp-agent-staging[bot] wants to merge 3 commits into
Conversation
Adds isDisabled: Boolean! to the TeamMember and WorkspaceMember GraphQL types (schema + cynic structs), threads is_disabled through the app-side TeamMember/WorkspaceMember models, and dims disabled members with an explanatory tooltip in every client surface that renders a member row: - Settings > Teams member list (email text + role chip dimmed, action icon/menu stays at normal brightness and enabled). - The billing/usage per-member breakdown table, which also lists workspace members by email. is_disabled is not persisted to the local sqlite cache; it's a live-refreshed hint, so staleness only produces false negatives. Refs APP-5480. Co-Authored-By: Warp <agent@warp.dev>
…sabled-members-client # Conflicts: # app/src/workspaces/gql_convert_tests.rs
…ments - Merge master to resolve the branch conflict. - teams_page.rs: replace the unwrap_or_default() mouse-state fallback with a debug_assert on the item/mouse-state length invariant plus direct indexing, so a divergence fails loudly instead of fabricating a transient handle. - Extract the dim-color and tooltip-text decisions in both teams_page.rs and billing_cycle_usage_rows.rs into small pure functions, and add unit tests pinning that a disabled row picks the dimmed color and the exact tooltip copy. - Delete comments that only restated field names/structure. Co-Authored-By: Warp <agent@warp.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR selects a new field,
isDisabled: Boolean!, on bothTeamMemberandWorkspaceMember. Selecting a field the server doesn't yet serve is a GraphQL document validation failure (FieldsOnCorrectType) — the server rejects the entire operation, not just the new field. A nullable field would fail identically; nothing defuses this except deploy order.Blast radius covers more than the Teams page.
crates/graphql/src/api/workspace.rsdefines a single sharedWorkspacecynic struct that bothGetWorkspacesMetadataForUserand theCreateTeammutation embed. Both operations transitively selectTeamMember.isDisabledandWorkspaceMember.isDisabled, so shipping this before the server deploys breaks workspace metadata loading and team creation, not just Settings > Teams.Summary
Implements APP-5480: workspace/team members whose account is disabled (
users.is_disabled) are grayed out with a "This user's account is disabled" tooltip everywhere the client renders a member row, instead of being hidden. Supersedes #15245, which covered team members only.Changes
crates/warp_graphql_schema/api/schema.graphql: addedisDisabled: Boolean!(with field description) toTeamMemberandWorkspaceMember, hand-edited to match what the generator will emit once the server ships the field.crates/graphql/src/api/workspace.rs: addedis_disabled: boolto both cynic structs (TeamMember,WorkspaceMember).app/src/workspaces/team.rs/app/src/workspaces/workspace.rs: addedis_disabled: boolto the app-sideTeamMemberandWorkspaceMembermodels, wired through theGql* -> *conversions ingql_convert.rs.app/src/settings_view/teams_page.rs): a disabled member's row — email text and role chip — renders dimmed, with a tooltip on hover. The trailing action icon/menu (remove, promote, etc.) stays at normal brightness and enabled; a disabled member remains removable. Tooltip usesoverlay_tool_tip_on_elementsince the page renders inside aClippedscroll viewport. Replaced the two parallelVec<MouseStateHandle>s this list used with a singleVec<ItemMouseStates>; the render path asserts the item/mouse-state vectors stay the same length and indexes directly, rather than fabricating a fresh handle if they ever diverge. Fixed a pre-existing sizing bug where the vector was sized from members only at construction but frompending_email_invites + memberson update.app/src/settings_view/billing_and_usage/billing_cycle_usage_rows.rs): this table also lists workspace members by email, so it gets the same dim + tooltip treatment on the member name, reusing the file's existing "former member" dimming pattern.usage_infoand other read-only aggregates don't render individual member identity as a row; no other client surface builds a list fromTeamMember/WorkspaceMember.Validation
cargo nextest run -p warp teams_page_tests gql_convert_tests billing_cycle_usage user_workspaces_tests admin_tests— 104 tests passed, including:disabled_member_is_flagged_but_keeps_removal_action,active_member_is_not_flagged_disabled,disabled_row_renders_dimmed_and_tooltipped(both surfaces, pins the exact dimmed color and tooltip copy so deleting the dimming/tooltip branches fails the test),team_member_conversion_preserves_is_disabled,workspace_member_conversion_preserves_is_disabled,per_member_rows_flag_disabled_members_from_the_roster,per_member_rows_never_flag_departed_members_as_disabled../script/formatandcargo clippy -p warp --all-targets --tests -- -D warningsboth clean.cargo check -p warp --bin warpand a fullcargo build --bin warpsucceed.Textelement's color or theoverlay_tool_tip_on_elementcall actually fires) isn't expressible as a unit test —warpui'sElementtrait has no introspection API for a constructed color or attached tooltip, and this repo's owngui-integration-testguidance says not to reach for the (much heavier) integration harness for a purely-visual assertion like this. Extracted the branching decisions into small pure functions and pinned those instead, which is the closest available proxy and does fail if the dimming/tooltip logic is deleted or inverted.WARP_API_KEYcan't load real team/billing data. Covers both surfaces: Settings > Teams and Settings > Billing and Usage's per-member table. In both, the active member renders at full brightness and the disabled member renders dimmed with the tooltip "This user's account is disabled" on hover.isDisabled(blocked on the server PR merging/deploying first, per the warning above).Plans: none
CHANGELOG-IMPROVEMENT: Disabled team/workspace members are now shown grayed out with an explanatory tooltip instead of appearing active.
Co-Authored-By: Warp agent@warp.dev