diff --git a/crates/warp_features/src/lib.rs b/crates/warp_features/src/lib.rs index c66d3acde9..f7237c59e7 100644 --- a/crates/warp_features/src/lib.rs +++ b/crates/warp_features/src/lib.rs @@ -943,12 +943,17 @@ pub enum FeatureFlag { /// setup or API key required. FactoryMcp, - /// Gates the TUI cost footer's credits⇄dollars toggle. When enabled (dogfood - /// / staging and local/dev builds), the footer usage entry follows the - /// persisted `agents.usage_display_mode` setting and is click-to-toggleable - /// between credits and dollars. When disabled (prod/stable), the footer - /// falls back to a static, non-interactive credits total. - TuiCostTransparency, + /// Gates client-side display of the real dollar cost (from `RequestCost.cost_in_cents`) + /// alongside credits in the GUI footer and TUI. Mirrors the server-side + /// `PricingTransparencyEnabled` flag in warp-server, but is a fully independent + /// flag — the two do not sync automatically. Consolidated from the former + /// `TuiCostTransparency` flag: when enabled (dogfood/staging and local/dev + /// builds), the TUI footer usage entry follows the persisted + /// `agents.usage_display_mode` setting and is click-to-toggleable between + /// credits and dollars; when disabled (prod/stable), it falls back to a + /// static, non-interactive credits total. Will also gate the GUI footer's + /// dollar display once that's built. + PricingTransparency, } static FLAG_STATES: [AtomicBool; cardinality::()] = @@ -1024,7 +1029,7 @@ pub const DOGFOOD_FLAGS: &[FeatureFlag] = &[ FeatureFlag::BoxDrawingGlyphs, FeatureFlag::WellKnownMcpIds, FeatureFlag::FactoryMcp, - FeatureFlag::TuiCostTransparency, + FeatureFlag::PricingTransparency, ]; /// Features enabled for feature preview build users (e.g.: Friends of Warp). diff --git a/crates/warp_tui/src/terminal_session_view_tests.rs b/crates/warp_tui/src/terminal_session_view_tests.rs index db1142a935..8f76fd8a16 100644 --- a/crates/warp_tui/src/terminal_session_view_tests.rs +++ b/crates/warp_tui/src/terminal_session_view_tests.rs @@ -4891,11 +4891,11 @@ fn footer_usage_entry_is_hidden_until_the_conversation_reports_usage() { /// still renders the usage entry — `Cost unavailable` in cost mode, never /// `$0.00` — even when credits happen to be zero. Cost mode is only reachable /// while the credits⇄dollars toggle is enabled, so this exercises the -/// `TuiCostTransparency`-on path. +/// `PricingTransparency`-on path. #[test] fn footer_usage_entry_shows_unknown_cost_even_with_zero_credits() { App::test((), |mut app| async move { - let _cost_transparency = FeatureFlag::TuiCostTransparency.override_enabled(true); + let _cost_transparency = FeatureFlag::PricingTransparency.override_enabled(true); app.update(|ctx| { ctx.add_singleton_model(|_| Appearance::mock()); let builder = TuiUiBuilder::from_app(ctx); diff --git a/crates/warp_tui/src/usage.rs b/crates/warp_tui/src/usage.rs index ba6645a618..7b4f2b344f 100644 --- a/crates/warp_tui/src/usage.rs +++ b/crates/warp_tui/src/usage.rs @@ -35,7 +35,7 @@ impl UsageToggle { /// setting (the element pass only has an immutable [`AppContext`]). /// /// The credits⇄dollars toggle is gated behind - /// [`FeatureFlag::TuiCostTransparency`]. When the flag is disabled + /// [`FeatureFlag::PricingTransparency`]. When the flag is disabled /// (prod/stable), this falls back to the pre-CODE-1831 behavior: a static, /// non-interactive credits total. The usage entry is still shown — only the /// click-to-toggle affordance is removed, and the persisted display mode is @@ -49,7 +49,7 @@ impl UsageToggle { on_click: impl FnMut(&mut TuiEventContext, &AppContext) + 'static, ) -> Box { let builder = TuiUiBuilder::from_app(app); - if !FeatureFlag::TuiCostTransparency.is_enabled() { + if !FeatureFlag::PricingTransparency.is_enabled() { return TuiText::new(entry_text(TuiUsageDisplayMode::Credits, totals)) .with_style(builder.muted_text_style()) .truncate() diff --git a/crates/warp_tui/src/usage_tests.rs b/crates/warp_tui/src/usage_tests.rs index 00cbb6ae4b..df41dd36e8 100644 --- a/crates/warp_tui/src/usage_tests.rs +++ b/crates/warp_tui/src/usage_tests.rs @@ -63,7 +63,7 @@ fn cost_mode_explicitly_marks_unknown_historical_cost() { ); } -/// The credits⇄dollars toggle is gated behind `TuiCostTransparency`: with the +/// The credits⇄dollars toggle is gated behind `PricingTransparency`: with the /// flag off (prod/stable) the footer renders a static credits total and never /// exposes the dollar cost even when the persisted mode is `Cost`; with the /// flag on (dogfood/staging + local/dev) the entry follows the persisted mode. @@ -81,7 +81,7 @@ fn footer_usage_entry_gates_the_cost_toggle_behind_the_feature_flag() { // Flag OFF: static credits; the persisted `Cost` mode is ignored so the // dollar cost is never surfaced. app.read(|ctx| { - let _guard = FeatureFlag::TuiCostTransparency.override_enabled(false); + let _guard = FeatureFlag::PricingTransparency.override_enabled(false); let entry = toggle.render_entry(TuiUsageDisplayMode::Cost, usage, ctx, |_, _| {}); let line = TuiPresenter::new() .present_element(entry, TuiRect::new(0, 0, 20, 1), ctx) @@ -101,7 +101,7 @@ fn footer_usage_entry_gates_the_cost_toggle_behind_the_feature_flag() { // Flag ON: the entry follows the persisted display mode, exposing the // dollar cost the toggle switches to. app.read(|ctx| { - let _guard = FeatureFlag::TuiCostTransparency.override_enabled(true); + let _guard = FeatureFlag::PricingTransparency.override_enabled(true); let entry = toggle.render_entry(TuiUsageDisplayMode::Cost, usage, ctx, |_, _| {}); let line = TuiPresenter::new() .present_element(entry, TuiRect::new(0, 0, 20, 1), ctx)