v1.1.0 — TokenMeter: progressive disclosure panel, palette settings command, configurable toggle shortcut
TokenMeter 1.1.0 is a feature release that rebuilds the sidebar around progressive disclosure. The panel reads at a glance: yellow section headings (Project, Session, Subagents), a primary token+cost line with the amount in light red, dim secondary metrics, and a nested subagent list with per-agent disclosure chevrons. Settings move out of the panel into a host palette dialog that never loses focus, and a configurable Ctrl+E shortcut expands or collapses every section together.
What changed
Progressive disclosure panel
- Section titles (
Project,Session,Subagents) render in the semantic yellowtheme().warningwith no icon; leading disclosure chevrons stay in the main text tone. - Metrics use a theme-relative tone hierarchy: the primary token+cost line is main text with only the
$amountintheme().error; input/output/reason/cache rows and(N tasks)counts use a dim background-relative detail tone; agent names usetheme().info. - The word
spentis gone from the panel — the$prefix already conveys cost — and the reasoning label is exactlyreason. - Numbers modes: Compact renders 3 rows (primary + paired input/output + paired reason/cache); Precise renders 5 independent rows (tokens+cost, input, output, reason, cache). Every value stays visible at the 22-column floor.
- Subagents is hidden entirely while the session has no delegated groups and appears automatically with the first one; the
0 agents · 0 taskscaption never shows. - Agent rows are
↳ name (N tasks) ▶closed /↳ name (N tasks) ▼open, with the per-agent chevron trailing the header and metric rows indented beneath the name. - Master and section disclosure stay transient; the Subagents expanded preference remains durable.
Palette settings command and dialog
TokenMeter: Settingsopens a hostDialogSelectfrom the command palette — there is no in-panel settings screen.- Selecting an option cycles the preference on the same dialog instance; the dialog is never recreated, so focus and the filter query survive each change.
- Preferences: Cache (combined/separated), Numbers (compact/precise), Summary (session/project), Subagents (collapsed/expanded), and Shortcut.
Configurable toggle shortcut
- New command
tokenmeter.toggle-sectionsexpands/collapses Project, Session, and Subagents together; bound by default toCtrl+E. - The Shortcut row in Settings cycles
Ctrl+E→Ctrl+Shift+E→Ctrl+M→Off; the choice persists undertokenmeter.toggle.shortcutand re-registers the keymap layer live — no restart. - With
Off, the command stays visible in the palette but no key triggers it. - Both commands use the modern
api.keymap.registerLayer({ commands, bindings }); disposers release inapi.lifecycle.onDispose.
No version literal, no icon dependencies
- The sidebar no longer renders a version literal next to the title, and it no longer depends on Nerd Font PUA codepoints: only plain Unicode
▶/▼/↳glyphs remain. The icon resource set and the stale sidebar screenshot were removed from the repo.
Upgrade
From 1.0.1 (or earlier):
- Pinned users: change the pin to
1.1.0in your TUI config, then restart OpenCode. - Unpinned users: OpenCode resolves
lateston launch — restart OpenCode to pick up 1.1.0.
{
"$schema": "https://opencode.ai/tui.json",
"plugin": ["opencode-tokenmeter-tui"]
}OpenCode installs plugin dependencies automatically — there is no npm install step. To update a cached plugin, remove ~/.cache/opencode/packages/opencode-tokenmeter-tui@latest and restart.
Known issues
- The global host command palette keeps its own search state per open; TokenMeter cannot influence it (the plugin-owned settings dialog preserves its filter).
- Biome reports style-level
noNonNullAssertionwarnings in the test suite (0 errors); one uncovered render branch insection.tsxsits at 93.18% line coverage, well above the 80% gate. - Project totals include deleted sessions from the first run of 1.0.0 onward; sessions deleted before the plugin's SQLite store existed are not counted retroactively.
Rollback
1.0.1 remains a fully loadable published version. If 1.1.0 regresses:
- Users: pin back to
1.0.1in the TUI config (or remove the plugin entry) and restart; report the failure so a 1.1.1 can be cut. - Maintainer: the release pipeline is tag-driven (
v1.1.0→ preflight → publish → verify). A regression in 1.1.0 is corrected by cutting 1.1.1, not by re-pointing 1.1.0 — npm versions are immutable. Keep this document as the single release record until the next tag renames it.