mirror of
https://github.com/openai/codex.git
synced 2026-05-05 22:01:37 +03:00
Remove context status-line meter (#17420)
Addresses #17313 Problem: The visual context meter in the status line was confusing and continued to draw negative feedback, and context reporting should remain an explicit opt-in rather than part of the default footer. Solution: Remove the visual meter, restore opt-in context remaining/used percentage items that explicitly say "Context", keep existing context-usage configs working as a hidden alias, and update the setup text and snapshots.
This commit is contained in:
@@ -13,9 +13,9 @@ expression: "render_lines(&view, 72)"
|
||||
[x] git-branch Current Git branch (omitted when unavaila…
|
||||
[ ] model-with-reasoning Current model name with reasoning level
|
||||
[ ] project-root Project root directory (omitted when unav…
|
||||
[ ] context-usage Visual meter of context window usage (omi…
|
||||
[ ] context-remaining Percentage of context window remaining (o…
|
||||
[ ] context-used Percentage of context window used (omitte…
|
||||
[ ] five-hour-limit Remaining usage on 5-hour usage limit (om…
|
||||
[ ] weekly-limit Remaining usage on weekly usage limit (om…
|
||||
|
||||
gpt-5-codex · ~/codex-rs · jif/statusline-preview
|
||||
Use ↑↓ to navigate, ←→ to move, space to select, enter to confirm, esc
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//! - Model information (name, reasoning level)
|
||||
//! - Directory paths (current dir, project root)
|
||||
//! - Git information (branch name)
|
||||
//! - Context usage (meter, window size)
|
||||
//! - Context usage (remaining %, used %, window size)
|
||||
//! - Usage limits (5-hour, weekly)
|
||||
//! - Session info (thread title, ID, tokens used)
|
||||
//! - Application version
|
||||
@@ -22,6 +22,7 @@ use ratatui::layout::Rect;
|
||||
use ratatui::text::Line;
|
||||
use std::collections::BTreeMap;
|
||||
use std::collections::HashSet;
|
||||
use strum::IntoEnumIterator;
|
||||
use strum_macros::Display;
|
||||
use strum_macros::EnumIter;
|
||||
use strum_macros::EnumString;
|
||||
@@ -62,15 +63,14 @@ pub(crate) enum StatusLineItem {
|
||||
/// Current git branch name (if in a repository).
|
||||
GitBranch,
|
||||
|
||||
/// Visual meter of context window usage.
|
||||
/// Percentage of context window remaining.
|
||||
ContextRemaining,
|
||||
|
||||
/// Percentage of context window used.
|
||||
///
|
||||
/// Also accepts legacy `context-remaining` and `context-used` config values.
|
||||
#[strum(
|
||||
to_string = "context-usage",
|
||||
serialize = "context-remaining",
|
||||
serialize = "context-used"
|
||||
)]
|
||||
ContextUsage,
|
||||
/// Also accepts the legacy `context-usage` config value.
|
||||
#[strum(to_string = "context-used", serialize = "context-usage")]
|
||||
ContextUsed,
|
||||
|
||||
/// Remaining usage on the 5-hour rate limit.
|
||||
FiveHourLimit,
|
||||
@@ -112,8 +112,11 @@ impl StatusLineItem {
|
||||
StatusLineItem::CurrentDir => "Current working directory",
|
||||
StatusLineItem::ProjectRoot => "Project root directory (omitted when unavailable)",
|
||||
StatusLineItem::GitBranch => "Current Git branch (omitted when unavailable)",
|
||||
StatusLineItem::ContextUsage => {
|
||||
"Visual meter of context window usage (omitted when unknown)"
|
||||
StatusLineItem::ContextRemaining => {
|
||||
"Percentage of context window remaining (omitted when unknown)"
|
||||
}
|
||||
StatusLineItem::ContextUsed => {
|
||||
"Percentage of context window used (omitted when unknown)"
|
||||
}
|
||||
StatusLineItem::FiveHourLimit => {
|
||||
"Remaining usage on 5-hour usage limit (omitted when unavailable)"
|
||||
@@ -137,25 +140,6 @@ impl StatusLineItem {
|
||||
}
|
||||
}
|
||||
|
||||
const SELECTABLE_STATUS_LINE_ITEMS: &[StatusLineItem] = &[
|
||||
StatusLineItem::ModelName,
|
||||
StatusLineItem::ModelWithReasoning,
|
||||
StatusLineItem::CurrentDir,
|
||||
StatusLineItem::ProjectRoot,
|
||||
StatusLineItem::GitBranch,
|
||||
StatusLineItem::ContextUsage,
|
||||
StatusLineItem::FiveHourLimit,
|
||||
StatusLineItem::WeeklyLimit,
|
||||
StatusLineItem::CodexVersion,
|
||||
StatusLineItem::ContextWindowSize,
|
||||
StatusLineItem::UsedTokens,
|
||||
StatusLineItem::TotalInputTokens,
|
||||
StatusLineItem::TotalOutputTokens,
|
||||
StatusLineItem::SessionId,
|
||||
StatusLineItem::FastMode,
|
||||
StatusLineItem::ThreadTitle,
|
||||
];
|
||||
|
||||
/// Runtime values used to preview the current status-line selection.
|
||||
#[derive(Clone, Debug, Default, Eq, PartialEq)]
|
||||
pub(crate) struct StatusLinePreviewData {
|
||||
@@ -232,7 +216,7 @@ impl StatusLineSetupView {
|
||||
}
|
||||
}
|
||||
|
||||
for item in SELECTABLE_STATUS_LINE_ITEMS.iter().cloned() {
|
||||
for item in StatusLineItem::iter() {
|
||||
let item_id = item.to_string();
|
||||
if used_ids.contains(&item_id) {
|
||||
continue;
|
||||
@@ -317,19 +301,27 @@ mod tests {
|
||||
use crate::app_event::AppEvent;
|
||||
|
||||
#[test]
|
||||
fn context_usage_is_canonical_and_accepts_legacy_ids() {
|
||||
assert_eq!(StatusLineItem::ContextUsage.to_string(), "context-usage");
|
||||
assert_eq!(
|
||||
"context-usage".parse::<StatusLineItem>(),
|
||||
Ok(StatusLineItem::ContextUsage)
|
||||
);
|
||||
assert_eq!(
|
||||
"context-remaining".parse::<StatusLineItem>(),
|
||||
Ok(StatusLineItem::ContextUsage)
|
||||
);
|
||||
fn context_used_accepts_context_usage_legacy_id() {
|
||||
assert_eq!(StatusLineItem::ContextUsed.to_string(), "context-used");
|
||||
assert_eq!(
|
||||
"context-used".parse::<StatusLineItem>(),
|
||||
Ok(StatusLineItem::ContextUsage)
|
||||
Ok(StatusLineItem::ContextUsed)
|
||||
);
|
||||
assert_eq!(
|
||||
"context-usage".parse::<StatusLineItem>(),
|
||||
Ok(StatusLineItem::ContextUsed)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn context_remaining_is_separate_selectable_id() {
|
||||
assert_eq!(
|
||||
"context-remaining".parse::<StatusLineItem>(),
|
||||
Ok(StatusLineItem::ContextRemaining)
|
||||
);
|
||||
assert_eq!(
|
||||
StatusLineItem::ContextRemaining.to_string(),
|
||||
"context-remaining"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user