mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
tui: label compact rate-limit percentages (#24314)
## Summary The compact TUI status line already renders rate-limit percentages as remaining capacity, but the text did not say so. That made high-usage red indicators ambiguous because values like `weekly 6%` could be read as either used or remaining. This PR labels the compact rate-limit values explicitly as `left` across the status line, terminal title, and setup previews. Addresses #24274
This commit is contained in:
@@ -586,7 +586,7 @@ async fn status_line_uses_secondary_fallback_for_unsupported_window() {
|
||||
|
||||
assert_eq!(
|
||||
chat.status_line_value_for_item(crate::bottom_pane::StatusLineItem::WeeklyLimit),
|
||||
Some("secondary usage 50%".to_string())
|
||||
Some("secondary usage 50% left".to_string())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -614,11 +614,11 @@ async fn status_line_legacy_limit_items_prefer_matching_windows() {
|
||||
|
||||
assert_eq!(
|
||||
chat.status_line_value_for_item(crate::bottom_pane::StatusLineItem::FiveHourLimit),
|
||||
Some("5h 60%".to_string())
|
||||
Some("5h 60% left".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
chat.status_line_value_for_item(crate::bottom_pane::StatusLineItem::WeeklyLimit),
|
||||
Some("weekly 6%".to_string())
|
||||
Some("weekly 6% left".to_string())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -646,11 +646,11 @@ async fn status_line_shows_secondary_non_weekly_when_primary_is_weekly() {
|
||||
|
||||
assert_eq!(
|
||||
chat.status_line_value_for_item(crate::bottom_pane::StatusLineItem::FiveHourLimit),
|
||||
Some("monthly 65%".to_string())
|
||||
Some("monthly 65% left".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
chat.status_line_value_for_item(crate::bottom_pane::StatusLineItem::WeeklyLimit),
|
||||
Some("weekly 6%".to_string())
|
||||
Some("weekly 6% left".to_string())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -678,7 +678,7 @@ async fn status_line_five_hour_item_omits_weekly_only_limit() {
|
||||
);
|
||||
assert_eq!(
|
||||
chat.status_line_value_for_item(crate::bottom_pane::StatusLineItem::WeeklyLimit),
|
||||
Some("weekly 91%".to_string())
|
||||
Some("weekly 91% left".to_string())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -702,7 +702,7 @@ async fn status_line_single_monthly_primary_omits_weekly_limit_item() {
|
||||
|
||||
assert_eq!(
|
||||
chat.status_line_value_for_item(crate::bottom_pane::StatusLineItem::FiveHourLimit),
|
||||
Some("monthly 65%".to_string())
|
||||
Some("monthly 65% left".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
chat.status_line_value_for_item(crate::bottom_pane::StatusLineItem::WeeklyLimit),
|
||||
@@ -734,7 +734,7 @@ async fn status_line_secondary_only_non_weekly_limit_omits_primary_limit_item()
|
||||
);
|
||||
assert_eq!(
|
||||
chat.status_line_value_for_item(crate::bottom_pane::StatusLineItem::WeeklyLimit),
|
||||
Some("monthly 65%".to_string())
|
||||
Some("monthly 65% left".to_string())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ async fn status_surface_preview_omits_unavailable_rate_limit_items() {
|
||||
&mut chat,
|
||||
&[StatusLineItem::FiveHourLimit, StatusLineItem::WeeklyLimit]
|
||||
),
|
||||
"weekly 91%"
|
||||
"weekly 91% left"
|
||||
);
|
||||
assert_eq!(
|
||||
title_preview_line(
|
||||
@@ -256,7 +256,7 @@ async fn status_surface_preview_omits_unavailable_rate_limit_items() {
|
||||
TerminalTitleItem::WeeklyLimit
|
||||
],
|
||||
),
|
||||
"weekly 91%"
|
||||
"weekly 91% left"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user