[REV-1871] Billing & Usage V2: workspace-settings CTA for native-workspaces admins - #14564
Draft
warp-agent-staging[bot] wants to merge 1 commit into
Draft
[REV-1871] Billing & Usage V2: workspace-settings CTA for native-workspaces admins#14564warp-agent-staging[bot] wants to merge 1 commit into
warp-agent-staging[bot] wants to merge 1 commit into
Conversation
…spaces admins Workspace admins on a tier with NativeWorkspaces enabled now see "Open the admin panel to view and edit workspace settings and spend limits." in the Billing & Usage (V2) visibility CTA banner, since the admin panel owns the whole workspace settings surface for them rather than just per-user spend limits. Every other viewer keeps today's granularity-derived copy and gates unchanged. To evaluate the new condition on the client, plumb the server's existing Tier.nativeWorkspacesPolicy through the client GraphQL schema, the cynic Tier fragment, the app-side Tier, and the GraphQL conversion. Co-Authored-By: Warp <agent@warp.dev> Co-Authored-By: Oz <oz-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.
Description
On Settings → Billing & Usage (V2), the grey callout under the team totals currently always reads "Open the admin panel to set per-user spend limits." for admins with full usage visibility.
When the viewer is a workspace admin and the workspace's tier has NativeWorkspaces enabled, the admin panel owns the whole workspace settings surface, not just per-user spend limits. This PR changes the trailing copy for exactly that case:
Open the admin panelto view and edit workspace settings and spend limits.The link text (
Open the admin panel), theOpenAdminPanelaction, and theUsersicon are identical in both cases; only the trailing sentence differs.Plumbing the NativeWorkspaces signal
The server already exposes
Tier.nativeWorkspacesPolicy, but the client never consumed it. To evaluate the new condition, this PR carries it through the client stack, mirroringmultiAdminPolicy:crates/warp_graphql_schema/api/schema.graphql— addtype NativeWorkspacesPolicy { enabled: Boolean! }andTier.nativeWorkspacesPolicy(matching the server'sgraphql/v2/billing.graphqls, in the schema's alphabetical order so a future full regeneration is a no-op here).crates/graphql/src/api/billing.rs— add the field to the cynicTierfragment, so every existingTierselection (including the workspace-metadata query) picks it up automatically.app/src/workspaces/workspace.rs— addNativeWorkspacesPolicy+Tier::native_workspaces_policy, plus aWorkspace::is_native_workspaces_enabled()helper.app/src/workspaces/gql_convert.rs— convert the new policy.app/src/settings_view/billing_and_usage/billing_cycle_usage_section.rs— newviewer_is_native_workspaces_admincheck selects the new CTA copy; the existing granularity path is untouched and used verbatim otherwise.Notes for the reviewer
…spend limits.) to match the four existing CTA strings. The request wrote it without one — happy to drop it.Linked Issue
REV-1871
ready-to-implement(factory pipeline:triage-done→impl-done; speccing was explicitly skipped by the requester).Testing
No new tests were added — intentionally, at the requester's explicit request ("don't give me tests"). The existing billing suite was run unchanged as a regression check.
Checks run from the repo root on this branch, all passing:
./script/format --checkcargo check -p warp --all-targetscargo clippy -p warp -p warp_graphql --all-targets --tests -- -D warningscargo nextest run -p warp -E 'test(billing)'→ 38 passed, 0 failed (existing tests only)The full workspace suite is left to this PR's CI.
./script/runScreenshots / Videos
Visual proof is outstanding — the rendered banner could not be exercised in the cloud agent environment. Reaching this component requires a signed-in session on a multi-member workspace whose server-side tier has
nativeWorkspacesPolicy.enabled = true, and the copy is chosen from server-delivered billing metadata. No such account or server fixture is reachable from this sandbox (no credentials, and the policy value comes from the server), so the change is verified at the code level only.Manual repro for a reviewer who has such an account:
Agent Mode
Originating thread: https://warpdev.slack.com/archives/C0BDQDW8V5E/p1785454242185589
Conversation: https://staging.warp.dev/conversation/344f6be3-e26f-4105-83f2-eaecf5bc5040
Run: https://oz.staging.warp.dev/runs/019fb568-9f87-7033-91b2-3326de43991f
This PR was generated with Oz.