Skip to content

fix(tui): settings overlays — /cost in/out tokens, /profiles row fit, /config ellipsis + [RO] legend + server-default model, /permissions separator (#1405) - #1406

Merged
dennisonbertram merged 3 commits into
mainfrom
issue-settings-polish
Sep 6, 2026
Merged

fix(tui): settings overlays — /cost in/out tokens, /profiles row fit, /config ellipsis + [RO] legend + server-default model, /permissions separator (#1405)#1406
dennisonbertram merged 3 commits into
mainfrom
issue-settings-polish

Conversation

@dennisonbertram

Copy link
Copy Markdown
Owner

Closes #1405

Summary

Four settings overlays misled a first-time user: /cost reported 0 input tokens and the total as output, /profiles wrapped its highlighted row mid-word, /config cut values at 20 characters without an ellipsis (so the model read as deepseek/deepseek-v4) and never explained [RO], and /permissions drew a stray ── line. All four are fixed; /config also says the server default applies when no model is chosen.

Scope and issue reconciliation

The four items in #1405 plus the empty-model placeholder found while verifying (same seam, configEntriesFromModel). Nothing else.

Impact analysis reconciliation

  • cmd/harnesscli/tui/context_usage.go: cumulative prompt/completion tokens parsed from usage.delta; model.go: two new fields feed costSnapshotFromModel; the status bar's total is unchanged.
  • components/profilepicker/view.go: rows sized to the box content area (box width unchanged overall).
  • components/configpanel/view.go: value column sized to the dialog, ellipsis, footer legend; three snapshot goldens regenerated (footer text only).
  • model.go permissions overlay: panel width = terminal − 4 to fit boxOverlay.
  • Server/API untouched.

Architecture and duplication check

Searched rg 'costSnapshotFromModel|totalTokens' cmd/harnesscli/tui, rg innerWidth components/profilepicker, rg maxValLen components/configpanel. Changes stay inside the owning components.

Test-first evidence

Red command: go test ./cmd/harnesscli/tui/ -run 'TestCost_|ProfilePicker_Selected|ConfigPanel_Values|NoStraySeparator' (commit 0d782b8)
Observed failure: /cost must show 15,000 in and 700 out; /config must not cut the model id silently; stray separator line in /permissions: "│──". The profiles guard passed in the unit fixture (the wrap only reproduced live); it stays as a regression guard and the live capture below is the proof.
Green command: go test ./cmd/harnesscli/tui/... -race → 28 packages ok.

Verification evidence

Live tmux 120x40 after one real run (OpenRouter, DeepSeek V4 Pro), built binary:

│                                                                                        ↑ 15,743 in  ↓ 18 out  $0.0022│
│ >   bash-runner           gpt-4.1-mini          built-in    Script execution, pipeline tasks                       │
│     file-writer           gpt-4.1-mini          built-in    Code changes to specific files                         │
                    │> base_url          http://127.0.0.1:48096                            [RO]    │
                    │  model                                                               [RO]    │
                    │  workspace         /private/tmp/claude-501/-Users-dennison-develop…  [RO]    │
│Permissions                                                                                                           │
│────────────────────────────────────────────────────────────────────────────────────────────────────────────────────  │
│No permission rules active                                                                                            │

Rollout and rollback

TUI-only; rebuild with scripts/install.sh, restart the TUI. Rollback: revert.

Documentation

Engineering-log entry. No operator doc describes these overlays' internals.

Contract checklist

  • Linked issue follows the current structured contract and this PR closes it
  • Issue acceptance criteria, impact map, and scope were updated when the design changed
  • All callers, consumers, sources of truth, and similar abstractions were searched
  • No unrelated cleanup, hidden scope growth, duplicated wiring, or parallel abstraction was introduced
  • Tests were written first and the expected red failure was observed, or this is a strictly docs-only minor PR
  • Targeted checks and the repository-required full regression are green
  • Security, compatibility, lifecycle, deployment, observability, documentation, and rollback were reconciled
  • Real mouse/keyboard/API/operator behavior was exercised when the change is interaction- or integration-heavy

🤖 Generated with Claude Code

https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5

dennisonbertram and others added 3 commits September 6, 2026 13:57
…ipsis and [RO] legend, /permissions stray separator; profiles width guard

Red output: /cost must show 15,000 in and 700 out; /config must not cut the model id silently; stray separator line in /permissions: "│──".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
… rows fit the box, /config values get an ellipsis and a wider column with a [RO] legend, /permissions separator fits its box

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
…e model; engineering-log entry

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T18:07:50.663551Z 65420f1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dennisonbertram
dennisonbertram merged commit 06180ea into main Sep 6, 2026
2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65420f19a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -1,5 +1,10 @@
# Engineering Log

## 2026-09-06 — Settings overlays read wrong to a first-time user (#1405)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add the new log entry to the folder index

This commit adds the durable #1405 engineering-log entry while leaving docs/logs/INDEX.md unchanged, so the folder index does not expose the new record. Update the logs index in the same change.

AGENTS.md reference: AGENTS.md:L56-L56

Useful? React with 👍 / 👎.

## 2026-09-06 — Settings overlays read wrong to a first-time user (#1405)

- Symptom: `/cost` showed `↑ 0 in ↓ 15,760 out` after a run (the TUI only tracked a single total and passed it as output); `/profiles` wrapped its highlighted row mid-word; `/config` cut values at 20 characters with no ellipsis (the model id read as `deepseek/deepseek-v4`) and never explained `[RO]`, and showed an empty model cell before a model was chosen; `/permissions` drew a stray `──` line because its separator was as wide as the terminal inside a narrower box.
- Fix: `applyUsageDelta` keeps cumulative prompt/completion tokens for the cost snapshot; the profile picker sizes rows to the box content area; the config panel widens the value column to the dialog, ends cut values with `…`, adds `[RO] read-only` to the footer and a "(server default — use /model to choose)" placeholder; the permissions panel is sized to the overlay box. Config snapshot goldens regenerated. Live tmux captures in PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Record this task's success criteria

A repository-wide search finds no #1405 entry or corresponding success definition in docs/logs/long-term-thinking-log.md, even though this entry records the completed implementation. Add the command intent, user intent, and success criteria there so the task's completion contract is durable.

AGENTS.md reference: AGENTS.md:L23-L23

Useful? React with 👍 / 👎.

@dennisonbertram
dennisonbertram deleted the issue-settings-polish branch September 6, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant