Skip to content

feat(cli): responsive priority-based status line for narrow terminals (#3421) - #3423

Open
me2seeks wants to merge 2 commits into
apache:mainfrom
me2seeks:fix/3421-responsive-status-line
Open

feat(cli): responsive priority-based status line for narrow terminals (#3421)#3423
me2seeks wants to merge 2 commits into
apache:mainfrom
me2seeks:fix/3421-responsive-status-line

Conversation

@me2seeks

@me2seeks me2seeks commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

At ≤100 cols the status line hard-truncated the right side mid-token (cache 6…), treating low-value static segments (connection, cwd) the same as safety/budget-relevant ones. A typical session already overflows 80 cols (~84 chars with no usage segments; ~122 with ctx/cost/cache and a long model id).

renderMakaPiStatusLine now assembles segments with drop ranks and degrades responsively:

  • Drop order: cache %$cost → connection slug → thinking:swarm/graph → cwd → (final fallback: existing fitLine truncation)
  • cwd degrades progressively: ~/full/path → basename → dropped; roots and paths whose basename is empty or the path itself (C:\, /, ~) drop directly instead of rendering an empty segment (review P3)
  • Never dropped: title, permission mode, model, live goal, ctx
  • ≥120 cols rendering is unchanged; no new configuration surface (user-facing segment configuration is raised as an open question on the issue and can land independently later)

Fixes #3421

Verification

  • pi-transcript.test.js 62/62 (new: drop order, cwd basename degradation, never-drop invariant, drive-root edge)
  • pi-tui-runner.test.js 119/119 (the one test asserting cache 40% now uses a 120-col terminal — at the default 80 that segment is correctly dropped)
  • biome lint + format clean; full dependency chain + cli build (typecheck) pass

AI use

  • Generative tooling made a substantive contribution
  • No generative tool made a substantive contribution

Tool(s) and scope: Maka (AI coding agent) authored the design, implementation, and tests; the diff was human-reviewed before push. Generated-by: Maka trailers are present on both commits and retained on this branch.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tightening the status-line degradation order. I reviewed the exact head and the current green test check. The implementation matches the intended priority order and keeps the existing metadata authority. I found no blocking issues; the inline P3 is only a small Windows display edge case.\n\nAI-assisted review disclosure: Codex performed an exact-head delegated review; I verified the finding and current PR state and approved this exact head.

Comment thread packages/cli/src/pi-transcript.ts Outdated
@Astro-Han

Copy link
Copy Markdown
Contributor

Before merging, Could We also state the tool used for this PR?

@me2seeks

me2seeks commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Tool disclosure, as requested: this PR was implemented by Maka, an AI coding agent running on my machine — design, code, and tests were agent-authored; I reviewed the diff before push. Local verification: pi-transcript.test.js 62/62, pi-tui-runner.test.js 119/119, biome format clean.

@me2seeks
me2seeks requested a review from Astro-Han August 22, 2026 13:26

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

…apache#3421)

The status line joined every segment left-to-right and hard-truncated
the right side on overflow, cutting whichever segment happened to sit
at the boundary mid-token and treating low-value static segments
(connection, cwd) the same as safety- and budget-relevant ones.

Segments now carry a drop rank; on overflow whole segments drop
lowest-value-first (cache, cost, connection, thinking, orchestration),
cwd degrades full -> basename -> dropped, and title/permission
mode/goal/ctx never drop. Wide rendering is unchanged; the previous
hard truncation remains only as the final fallback.

Generated-by: Maka
…pache#3421)

Review P3: on Windows a drive root (C:\) has an empty basename; with it
as the shortened form the segment stayed present and left a dangling
separator. Roots and paths whose basename is the path itself (~, /,
C:\) now skip the shortened form and drop directly.

Generated-by: Maka
@me2seeks
me2seeks force-pushed the fix/3421-responsive-status-line branch from f2e567b to e735404 Compare August 22, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): responsive priority-based status line for narrow terminals

2 participants