Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions crates/warp_features/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<FeatureFlag>()] =
Expand Down Expand Up @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions crates/warp_tui/src/terminal_session_view_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions crates/warp_tui/src/usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,7 +49,7 @@ impl UsageToggle {
on_click: impl FnMut(&mut TuiEventContext, &AppContext) + 'static,
) -> Box<dyn TuiElement> {
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()
Expand Down
6 changes: 3 additions & 3 deletions crates/warp_tui/src/usage_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand All @@ -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)
Expand Down
Loading