feat: Claude Code-style statusline footer, OAuth usage windows, and pinned-gray input border #40

Merged
owlburtoe merged 2 commits from clfy-footer-input-box into master 2026-07-16 16:30:49 -04:00
Owner

What

Restyles pi's bottom-of-screen UI to match Berto's Claude Code setup, in two commits:

e9fe526 — statusline footer + gray input border

  • Replaces pi's stock footer via the first-class ctx.ui.setFooter API with the statusline grammar from ~/.claude/statusline-command.sh: dir │ ⎇ branch │ model │ Ctx: N%, 2-space indent, separators, three color modes (colored / single hex / monochrome).
  • Pins the input-box border gray at every thinking level by wrapping Theme.prototype.getThinkingBorderColor — pi reassigns editor.borderColor from that method on its own events, so the wrapper's colorizer re-checks the setting on every render (live-reflecting). Bash mode's recolor is kept: live capture confirmed Claude Code also recolors bash mode (211) while staying gray (244) in every permission mode.
  • New Footer section on the Claudify screen: footer style (claude/pi), color mode, hex color text row (validated), usage-bar toggle, input border (gray/thinking).

f97d14f — model-aware OAuth usage windows (authored by pi during a session handover, reviewed here)

  • Quota segments follow the active model's provider, gated on isUsingOAuth: Anthropic shows five-hour Usage + weekly Week (api.anthropic.com/api/oauth/usage); OpenAI Codex shows Week (chatgpt.com/backend-api/wham/usage). Each window renders label: N% ▓▓░░ → Reset: t.
  • Tokens resolve per-request through ctx.modelRegistry — never read from auth.json, persisted, logged, or cached. Only validated percentages/reset timestamps cache in memory (60s). Failures, API-key auth, and unsupported providers degrade to ~ placeholders.
  • Replaces the interim Effort segment; footerContextBarfooterUsageBar with a normalizeAliases migration.

Capture + decisions doc: docs/plans/2026-07-16-cc-input-box-footer.md (live tmux capture of Claude Code v2.1.211, all permission modes + bash mode).

Known caveats

  • Both quota endpoints are undocumented and provider-owned; the Anthropic request sends Claude Code's user-agent to be accepted. Breakage degrades to placeholders, never a crash.
  • The script's pace-marker and 24-hour time option are not ported in this compact first version.

Test plan

  • New suite scripts/test-footer.ts (suite count 14 → 15): line grammar byte-for-byte in all three color modes, context threshold tiers, quota-window rendering, Anthropic/OpenAI response parsing, provider-switch and disposal races, border-patch idempotence + live reflection, Footer section rows + hex validation.
  • Full suite 15/15 green; tsc --noEmit --strict clean.
  • Code review pass (no findings at the confidence bar).
  • Eyeball in a live pi session after merge (pi hangs under a headless PTY, so this can't be automated).
## What Restyles pi's bottom-of-screen UI to match Berto's Claude Code setup, in two commits: **`e9fe526` — statusline footer + gray input border** - Replaces pi's stock footer via the first-class `ctx.ui.setFooter` API with the statusline grammar from `~/.claude/statusline-command.sh`: `dir │ ⎇ branch │ model │ Ctx: N%`, 2-space indent, ` │ ` separators, three color modes (colored / single hex / monochrome). - Pins the input-box border gray at every thinking level by wrapping `Theme.prototype.getThinkingBorderColor` — pi reassigns `editor.borderColor` from that method on its own events, so the wrapper's colorizer re-checks the setting on every render (live-reflecting). Bash mode's recolor is kept: live capture confirmed Claude Code also recolors bash mode (211) while staying gray (244) in every permission mode. - New **Footer** section on the Claudify screen: footer style (claude/pi), color mode, hex color text row (validated), usage-bar toggle, input border (gray/thinking). **`f97d14f` — model-aware OAuth usage windows (authored by pi during a session handover, reviewed here)** - Quota segments follow the active model's provider, gated on `isUsingOAuth`: Anthropic shows five-hour `Usage` + weekly `Week` (`api.anthropic.com/api/oauth/usage`); OpenAI Codex shows `Week` (`chatgpt.com/backend-api/wham/usage`). Each window renders `label: N% ▓▓░░ → Reset: t`. - Tokens resolve per-request through `ctx.modelRegistry` — never read from `auth.json`, persisted, logged, or cached. Only validated percentages/reset timestamps cache in memory (60s). Failures, API-key auth, and unsupported providers degrade to `~` placeholders. - Replaces the interim Effort segment; `footerContextBar` → `footerUsageBar` with a `normalizeAliases` migration. Capture + decisions doc: `docs/plans/2026-07-16-cc-input-box-footer.md` (live tmux capture of Claude Code v2.1.211, all permission modes + bash mode). ## Known caveats - Both quota endpoints are undocumented and provider-owned; the Anthropic request sends Claude Code's user-agent to be accepted. Breakage degrades to placeholders, never a crash. - The script's pace-marker `┃` and 24-hour time option are not ported in this compact first version. ## Test plan - [x] New suite `scripts/test-footer.ts` (suite count 14 → 15): line grammar byte-for-byte in all three color modes, context threshold tiers, quota-window rendering, Anthropic/OpenAI response parsing, provider-switch and disposal races, border-patch idempotence + live reflection, Footer section rows + hex validation. - [x] Full suite 15/15 green; `tsc --noEmit --strict` clean. - [x] Code review pass (no findings at the confidence bar). - [ ] Eyeball in a live pi session after merge (pi hangs under a headless PTY, so this can't be automated).
Ports the grammar of Berto's Claude Code statusline (dir | branch | model |
model-aware Ctx bar) to pi via ctx.ui.setFooter, adds an Effort segment from
pi's thinking level, and pins the input-box border gray at every reasoning
level by wrapping Theme.getThinkingBorderColor (bash mode's recolor kept,
matching Claude Code). New Footer section on the Claudify screen: footer
style (claude/pi), color mode (colored/single/monochrome), hex color, context
bar toggle, input border mode — all live-reflecting.

Capture + decisions: docs/plans/2026-07-16-cc-input-box-footer.md. The
script's Usage/Reset segment is deliberately omitted (no rate-limit source in
pi). New suite scripts/test-footer.ts (14 -> 15).
feat: model-aware OAuth usage windows in the footer, replacing Effort
All checks were successful
Plane Sync / Close referenced Plane work items (pull_request) Successful in 3s
f97d14f409
Authored by pi (session handover), reviewed and verified here. The footer now
renders the script's full grammar: dir | branch | model | Ctx | quota windows
with bar and reset time. Anthropic OAuth shows the five-hour Usage plus weekly
Week window (api.anthropic.com/api/oauth/usage); OpenAI Codex OAuth shows Week
(chatgpt.com/backend-api/wham/usage). Provider follows the active model, gated
on isUsingOAuth; tokens are resolved per-request via ctx.modelRegistry, never
persisted, logged, or cached; validated percentages cache in memory for 60s
and failures degrade to ~ placeholders. footerContextBar becomes
footerUsageBar (normalizeAliases migrates the branch-local key); the Effort
segment is removed to match the captured statusline.
owlburtoe merged commit 2f610c99a1 into master 2026-07-16 16:30:49 -04:00
owlburtoe deleted branch clfy-footer-input-box 2026-07-16 16:30:50 -04:00
owlburtoe referenced this pull request from a commit 2026-07-16 17:18:32 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
owlburtoe/pi-claudify!40
No description provided.