Skip to content

New config to show skills+plugins in the tokens/cost row - #121

Merged
tmck-code merged 6 commits into
mainfrom
fix/skills-plugins-loc-cost-labels
Aug 31, 2026
Merged

New config to show skills+plugins in the tokens/cost row#121
tmck-code merged 6 commits into
mainfrom
fix/skills-plugins-loc-cost-labels

Conversation

@tmck-code

@tmck-code tmck-code commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Context

Headline change: the trailing column of the tokens/cost row now shows skills + plugins instead of the tokens-over-time sparkline. The sparkline isn't gone — it moves to its own optional full-width row, off by default:

  • [layout].show_tokens_over_time = true / YAS_SHOW_TOKENS_OVER_TIME=true — adds a "tokens over time" row (t/m rate + live sparkline) under the tokens/cost band. Documented in the README config table and yas.example.toml.

Alongside that, fixes three related rendering bugs surfacing across width/config combinations users actually hit:

  1. The skills + plugins trailing column vanished entirely (instead of rendering as an empty bordered section) when there were no skills/plugins loaded, which dragged the borders and labels for the neighboring loc r/w and cost sess/day sections along with it.
  2. The loc r/w and cost sess/day labels silently disappeared from the border row when show_icons=False, because label detection sniffed for an icon glyph that's gated on show_icons instead of using an explicit flag.
  3. The loc r/w label wasn't centered within its section — it centered against the long label form's width instead of the abbreviated form actually rendered.

No version bump on this branch (rebased onto main at 0.9.0).

Changes

Renderer / layout

  • claude/yas/layout.py — skills + plugins always occupy the trailing tokens/cost column; new opt-in tokens over time row below it. Consumes has_lines directly for the loc r/w label anchor; centers the loc r/w label using the abbreviated label form's width (matching what _fit_label actually renders) instead of the long form's width.
  • claude/yas/renderer.pytokens_cost no longer gates the skills+plugins trailing column on non-empty content; it now always renders (blank-padded) when width allows. Also returns an explicit has_lines flag instead of forcing callers to re-derive presence from rendered glyphs.
  • claude/yas/render/text.py, claude/yas/config.py, claude/yas/constants.pyshow_tokens_over_time config option and the new row's rendering + label constants.

Docs

  • README.md, yas.example.toml — document show_tokens_over_time.

Follow-ups from review

  • An overlong skills+plugins list is now truncated with to the real free column width (gate on PLUGINS_TRAILING_MIN_W) instead of being pre-clipped at 60 cols or shed entirely; new clip_visible() helper in render/text.py; leader_*trailing_* renames.

Tests

  • Updated test_tokens_cost.py, test_layout_seam.py, test_labels_layout.py, test_tool_counts_row.py, test_config.py for the new column/border layout.
  • Added test/test_tokens_over_time.py for the new row.
  • Regenerated test/fixtures/claude_dark_wide.ansi snapshot to match the corrected renderer output.

Checklist

  • Tests added or updated for new/changed behaviour
  • (bug fixes) a regression test now covers the situation so it can't come back

Screenshots / recording

before / after
kitchen-sink kitchen-sink
no-icons no-icons
tokens-over-time tokens-over-time
long-skills-plugins-185 long-skills-plugins-185

Benchmark

Command Mean [ms] Min [ms] Max [ms] Relative
main 45.6 ± 3.2 42.6 65.5 1.01 ± 0.08
PR 45.2 ± 1.3 42.4 48.7 1.00

System info

Key Value
OS Linux archlinux 7.1.8-arch1-3 #1 SMP PREEMPT_DYNAMIC Tue, 11 Aug 2026 09:16:08 +0000 x86_64 GNU/Linux
Claude Code 2.1.235 (Claude Code)
Terminal TERM=tmux-256color TERM_PROGRAM=tmux SHELL=/bin/bash COLORTERM=truecolor
Locale LANG=en_AU.UTF-8 LC_ALL=
Python Python 3.13.13
uv uv 0.12.3 (507230998 2026-08-07 x86_64-unknown-linux-gnu)

@tmck-code
tmck-code marked this pull request as ready for review August 19, 2026 14:33
The skills+plugins trailing column vanished entirely when empty instead
of rendering as a blank bordered section, dragging the loc r/w and cost
sections' borders/labels along with it. Separately, the loc r/w and cost
labels silently disappeared with show_icons=False because label
detection sniffed for an icon glyph instead of using an explicit flag.
Also centers the loc r/w label within its section using the abbreviated
label form actually rendered.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tmck-code
tmck-code force-pushed the fix/skills-plugins-loc-cost-labels branch from 0d4e98a to 3ff6820 Compare August 30, 2026 11:21
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tmck-code tmck-code changed the title Fix skills+plugins section collapse and loc/cost label visibility Show skills+plugins in the tokens/cost row; move the sparkline to an opt-in tokens-over-time row Aug 30, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tmck-code tmck-code changed the title Show skills+plugins in the tokens/cost row; move the sparkline to an opt-in tokens-over-time row New config to show skills+plugins in the tokens/cost row Aug 30, 2026
Test and others added 3 commits August 30, 2026 21:53
…ents, extract clip_visible

Gate the trailing column on PLUGINS_TRAILING_MIN_W rather than the full
measured list width so an overlong list is clipped with an ellipsis, not
dropped. Derive has_lines from the shed rung actually taken. Rename the
leader_* identifiers to trailing_*, extract clip_visible() for the three
ellipsis-clip sites, and trim the triplicated rationale comments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… not '…│'

Also return '' for zero-width budgets instead of a stray ellipsis, and add
regression tests for pad, zero budget, and a box-width sweep.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tmck-code
tmck-code merged commit 2c4fa60 into main Aug 31, 2026
6 checks passed
@tmck-code
tmck-code deleted the fix/skills-plugins-loc-cost-labels branch August 31, 2026 00:37
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.

1 participant