Skip to content

[REV-1871] Billing & Usage V2: workspace-settings CTA for native-workspaces admins - #14564

Draft
warp-agent-staging[bot] wants to merge 1 commit into
masterfrom
factory/rev-1871-native-workspaces-admin-cta
Draft

[REV-1871] Billing & Usage V2: workspace-settings CTA for native-workspaces admins#14564
warp-agent-staging[bot] wants to merge 1 commit into
masterfrom
factory/rev-1871-native-workspaces-admin-cta

Conversation

@warp-agent-staging

Copy link
Copy Markdown
Contributor

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:

  • New (workspace admin + NativeWorkspaces enabled): Open the admin panel to view and edit workspace settings and spend limits.
  • Everyone else: unchanged — same granularity-derived copy, same link text, same action, same icon, same gates.

The link text (Open the admin panel), the OpenAdminPanel action, and the Users icon 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, mirroring multiAdminPolicy:

  • crates/warp_graphql_schema/api/schema.graphql — add type NativeWorkspacesPolicy { enabled: Boolean! } and Tier.nativeWorkspacesPolicy (matching the server's graphql/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 cynic Tier fragment, so every existing Tier selection (including the workspace-metadata query) picks it up automatically.
  • app/src/workspaces/workspace.rs — add NativeWorkspacesPolicy + Tier::native_workspaces_policy, plus a Workspace::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 — new viewer_is_native_workspaces_admin check selects the new CTA copy; the existing granularity path is untouched and used verbatim otherwise.

Notes for the reviewer

  • Copy has a trailing period (…spend limits.) to match the four existing CTA strings. The request wrote it without one — happy to drop it.
  • The new branch takes precedence over the granularity-derived copy (reading "otherwise we fall back to the current conditions" literally), so a workspace admin on a NativeWorkspaces tier sees this CTA rather than an upgrade nudge or the FullBreakdown/non-enterprise suppression.
  • The banner's surrounding gates are unchanged: it still only renders inside the team-usage section, for admins, and only when the workspace has more than one member.

Linked Issue

REV-1871

  • The linked issue is labeled ready-to-implement (factory pipeline: triage-doneimpl-done; speccing was explicitly skipped by the requester).
  • Screenshots — see Screenshots / Videos below; visual proof is outstanding and the reason is documented there.

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 --check
  • cargo check -p warp --all-targets
  • cargo clippy -p warp -p warp_graphql --all-targets --tests -- -D warnings
  • cargo 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.

  • I have manually tested my changes locally with ./script/run

Screenshots / 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:

  1. Sign in as an admin of a multi-member workspace on a tier with NativeWorkspaces enabled.
  2. Open Settings → Billing & Usage (V2 page).
  3. The callout between the team totals and the per-member rows should read "Open the admin panel to view and edit workspace settings and spend limits." — the link still opens the admin panel.
  4. As any viewer outside that condition, the banner should be byte-identical to today (e.g. FullBreakdown enterprise admins still see "…to set per-user spend limits.").

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI 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.

…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>
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.

1 participant