[REV-1603 & REV-1606] Show billing V2 for solo free users#11434
Conversation
Co-Authored-By: Oz <oz-agent@warp.dev>
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR routes signed-in users with no current workspace through the Billing and Usage V2 page when BillingAndUsagePageV2 is enabled, while preserving legacy routing for legacy paid workspace plans and adding unit coverage for the routing helper.
Concerns
- For this user-facing settings-page change, please include screenshots or a screen recording demonstrating the free solo/no-workspace billing flow working end to end. The PR description does not include visual evidence, and the repo review guidance requires it for UI-impacting behavior changes.
Verdict
Found: 0 critical, 0 important, 1 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
- Split BillingCycleUsageSectionView::render into three cases: render_team_usage, render_own_usage_with_workspace, render_own_usage_solo, dispatched via a new shows_team_section() helper. - Move row constructors onto MemberUsageRow as methods (for_viewer, for_viewer_from_total, for_other_members, for_each_member) so they only depend on entries/members/primitives — no Workspace, AppContext, or AIRequestUsageModel. - Add viewer_base_limit helper for the workspace -> base_limit lookup; render helpers and build_rows resolve identity + base_limit themselves. - Rename build_row_card to render_row_card to match the render_* convention for Element-producing helpers. - Update tests to call MemberUsageRow::for_viewer. Co-Authored-By: Oz <oz-agent@warp.dev>
…ta on credits_used Co-Authored-By: Oz <oz-agent@warp.dev>
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
| pub fn has_non_viewer_data(entries: &[BillingCycleUsageEntry], viewer_uid: Option<&str>) -> bool { | ||
| entries.iter().any(|e| match &e.subject_type { | ||
| AiCreditsUsageAndCostSubjectType::Team => true, | ||
| AiCreditsUsageAndCostSubjectType::Team => e.credits_used > 0, |
There was a problem hiding this comment.
There was a problem hiding this comment.
Overview
Reviewed the Billing V2 routing change for signed-in users with no current workspace, the supporting usage-row rendering changes, and the new dispatch tests. The PR includes visual evidence for the user-facing billing page changes, and no approved spec context was available for additional spec-alignment checks.
Concerns
- None.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
…illing-v2-free-solo # Conflicts: # app/src/settings_view/billing_and_usage/billing_cycle_usage_rows.rs # app/src/settings_view/billing_and_usage/billing_cycle_usage_section.rs # app/src/settings_view/billing_and_usage_dispatch.rs
|
|
||
| let resets_text = self.render_resets_label(appearance, app); | ||
| let legend = self.render_legend(workspace, appearance); | ||
| let legend = workspace.and_then(|workspace| self.render_legend(workspace, appearance)); |
There was a problem hiding this comment.
nit: Should we also hide the legend when they're on a free team? Because I think right now we should the legend on a free team but not when they're not on a free team - we should keep it consistent right?
There was a problem hiding this comment.
yeah... i didnt really want to make assumptions about the types of costs etc that you can occur when you're on a free team / no team.
for example, I can't quite remember, but i think if you churn from build, you can still use your ambient agent addon credits (??)... even if thats not the case rn, i dont want this UI to hide that when this does become the case and u get different credit types back from the usage API
i just don't show the legend in the no-workspace case because we simply don't have the data to populate a legend.
(aside: I guess more accurately we should be showing "aggregated credits used" instead of a pink for "base credits", but in 99% of the teamless case, the only usage you're going to have is base)
| pub fn has_non_viewer_data(entries: &[BillingCycleUsageEntry], viewer_uid: Option<&str>) -> bool { | ||
| entries.iter().any(|e| match &e.subject_type { | ||
| AiCreditsUsageAndCostSubjectType::Team => true, | ||
| AiCreditsUsageAndCostSubjectType::Team => e.credits_used > 0, |
…#11434) ## Description Routes signed-in users with no current workspace through the V2 billing and usage page when the BillingAndUsagePageV2 flag is enabled. This preserves the existing V2 routing for free/build/enterprise workspaces and the legacy routing for legacy paid workspace plans. ## Linked Issue REV-1603 - [ ] The linked issue is labeled `ready-to-spec` or `ready-to-implement`. - [ ] Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes). ## Testing - [x] `cargo fmt --package warp` - [x] `cargo test -p warp settings_view::billing_and_usage_dispatch::tests --lib` - [x] `cargo clippy -p warp --lib` - [x] I have manually tested my changes locally with `./script/run` ### Free user with no team note: no billing period at the side because technically there is no "billing period" (there's no billing) but i think the "resets at" is sufficient TODO: we should probably show this bar as a % of the max base limit, instead of the "the max user on your team gets their bar at 100% and everyone else is normalized to that" <img width="1297" height="812" alt="image" src="https://github.com/user-attachments/assets/e5427825-344c-437a-b652-eb1c188044f3" /> ### Free user with a team <img width="1300" height="817" alt="image" src="https://github.com/user-attachments/assets/9585a92e-419c-4c46-9860-06fba391233e" /> ### Solo Build <img width="1728" height="1117" alt="image" src="https://github.com/user-attachments/assets/e05510bf-0aba-4b9c-aae4-7b643ef5747d" /> ### Solo business <img width="1728" height="1117" alt="image" src="https://github.com/user-attachments/assets/91c83df2-5e4c-49de-8188-b74a5150bb4a" /> ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode CHANGELOG-BUG-FIX: Fixed free solo users seeing the legacy Billing and usage settings page instead of the V2 page. _This PR was created by [Oz](https://warp.dev/oz) (running Codex)._ --------- Co-authored-by: Oz <oz-agent@warp.dev>
Description
Routes signed-in users with no current workspace through the V2 billing and usage page when the BillingAndUsagePageV2 flag is enabled. This preserves the existing V2 routing for free/build/enterprise workspaces and the legacy routing for legacy paid workspace plans.
Linked Issue
REV-1603
ready-to-specorready-to-implement.Testing
cargo fmt --package warpcargo test -p warp settings_view::billing_and_usage_dispatch::tests --libcargo clippy -p warp --lib./script/runFree user with no team
note: no billing period at the side because technically there is no "billing period" (there's no billing) but i think the "resets at" is sufficient
TODO: we should probably show this bar as a % of the max base limit, instead of the "the max user on your team gets their bar at 100% and everyone else is normalized to that"
Free user with a team
Solo Build
Solo business
Agent Mode
CHANGELOG-BUG-FIX: Fixed free solo users seeing the legacy Billing and usage settings page instead of the V2 page.
This PR was created by Oz (running Codex).