fix(tui): remove duplicate context statusline item (#18054)

Addresses #18045

Problem: `/statusline` exposed both `context-remaining` and
`context-remaining-percent` after conflicting PRs attempted to address
the same context-status issue, including #17637, allowing duplicate
footer segments.

Solution: Remove the duplicate `context-remaining-percent` status-line
item and update status-line tests and snapshots to use only canonical
`context-remaining`.
This commit is contained in:
Eric Traut
2026-04-16 09:00:16 -07:00
committed by GitHub
parent b4be3617f9
commit 8475d51655
5 changed files with 13 additions and 50 deletions

View File

@@ -66,10 +66,6 @@ pub(crate) enum StatusLineItem {
/// Percentage of context window remaining.
ContextRemaining,
/// Percentage of context window remaining.
#[strum(to_string = "context-remaining-percent")]
ContextRemainingPercent,
/// Percentage of context window used.
///
/// Also accepts the legacy `context-usage` config value.
@@ -119,9 +115,6 @@ impl StatusLineItem {
StatusLineItem::ContextRemaining => {
"Percentage of context window remaining (omitted when unknown)"
}
StatusLineItem::ContextRemainingPercent => {
"Percentage of context window remaining (omitted when unknown)"
}
StatusLineItem::ContextUsed => {
"Percentage of context window used (omitted when unknown)"
}
@@ -321,7 +314,7 @@ mod tests {
}
#[test]
fn context_remaining_is_separate_selectable_id() {
fn context_remaining_is_selectable_id() {
assert_eq!(
"context-remaining".parse::<StatusLineItem>(),
Ok(StatusLineItem::ContextRemaining)
@@ -332,18 +325,6 @@ mod tests {
);
}
#[test]
fn context_remaining_percent_is_separate_selectable_id() {
assert_eq!(
StatusLineItem::ContextRemainingPercent.to_string(),
"context-remaining-percent"
);
assert_eq!(
"context-remaining-percent".parse::<StatusLineItem>(),
Ok(StatusLineItem::ContextRemainingPercent)
);
}
#[test]
fn preview_uses_runtime_values() {
let preview_data = StatusLinePreviewData::from_iter([