Repository navigation
fix(cli): statusline density, color fallback, and activity-strip spacing #1064
Description
Problem
After #1053 landed the context statusline and activity strip, several chrome issues remain in the TUI:
-
No color capability fallback.
tui-ansi.tsunconditionally emits 24-bit truecolor. SettingNO_COLORor running on a basic terminal produces raw escape sequences or no color at all. Tracked in feat(cli): TUI usability pass — skill injection, parity with opencode, public-beta gate #549 P1. -
ctx segment often missing.
renderMakaPiStatusLinerequires bothmodelContextWindowandcontextRemainingto show the ctx segment.contextRemainingis an optional field — many providers omit it intoken_usageevents, so the entire context-usage display disappears. The feat(cli): TUI block visual grammar, context statusline, and activity strip #1053 spec specified a fallback ("else lasttoken_usageinput/total") that was never implemented. -
No visual warning on high context usage. The ctx percentage renders in
dimregardless of value. When context is near exhaustion (>80%, >95%) there is no color signal. -
cwd shows full path.
/Users/yuhan/workspace/oss/maka-agentis 38 characters — too long for a statusline slot. Should shorten to a~-relative path. -
thinking:defaultis noise. WhenthinkingLevelsexist butthinkingLevelis unset, the statusline always showsthinking:default(19 chars). This is only useful after the user explicitly changes the level; before that it wastes width. -
Activity strip touches the last transcript line. When the transcript's last entry is a thinking or tool row (the agent-work stack, no blank line between them),
Working… 12srenders directly below it with no separator. -
AskUserQuestion CJK IME cursor mispositioned. The
UserQuestionTextOverlaycreates a standaloneEditorbut does not seteditor.focused = true, so the terminal does not emit the hardware-cursor marker that IME candidate windows use for positioning. CJK input candidates jump to the terminal bottom. The fix is demonstrated in~/.pi/agent/extensions/question.ts.
Desired outcome
tui-ansi.tsreadsNO_COLOR/COLORTERM/TERMand downgrades 24-bit truecolor to 256/16/no-color. Benchmark: codexsupports-color3-level; pitheme.ts256 fallback.- ctx segment shows when
contextRemainingis missing, using the lasttoken_usageinputas an estimate of used tokens. - ctx percentage uses
yellow>80%,red>95%,dimotherwise. - cwd renders as
~/workspace/oss/maka-agentinstead of the full path. thinking:defaultis omitted; only an explicitly setthinkingLevelshows.- Activity strip has a blank separator from the last agent-work entry.
UserQuestionTextOverlaysetseditor.focused = trueso IME positions correctly.
Delivery seams
Each item is independently revertable. Items 1 and 3 must land together (color fallback is the foundation for ctx color warning).
- Color fallback —
tui-ansi.tscapability detection + downgrade. - ctx fallback —
pi-transcript.tsMakaPiUsageSummarytracks lastinput;renderMakaPiStatusLineuses it whencontextRemainingis absent. - ctx color warning —
pi-transcript.tsctx segment color by threshold. - cwd shortening —
pi-transcript.ts~-relative path. - thinking:default omission —
pi-transcript.tscondition change. - Activity strip spacing —
pi-tui-layout.tsorrenderMakaPiTranscriptseparator. - IME cursor fix —
pi-tui-pickers.tseditor.focused = true.
References
- feat(cli): TUI block visual grammar, context statusline, and activity strip #1053 (closed; original statusline + activity strip epic)
- feat(cli): TUI usability pass — skill injection, parity with opencode, public-beta gate #549 (open; P1 tracks NO_COLOR fallback)
- feat(desktop): make UI language selection coherent and complete #1052 (open; desktop locale — CLI localization is separate)
Activity
fix(cli): address Codex review findings for #1064
fix(cli): statusline density, color fallback, and activity-strip spac…
test(cli): pin color level so ANSI assertions are hermetic
fix: restore green CI on main (runtime prune regression + non-hermeti…