fix(statusline): account badge from label alone; context next to model - #18
Conversation
…next to model The account badge (CLAUDE_STATUSLINE_ACCOUNT_LABEL) was gated on CLAUDE_CODE_OAUTH_TOKEN also being set, so accounts switched via a separate credential store (CLAUDE_SECURESTORAGE_CONFIG_DIR) showed no badge. The label is user-set display text and now renders whenever it is set, independent of how the account was selected. Per-account cache isolation and background OAuth refresh remain keyed on CLAUDE_CODE_OAUTH_TOKEN. Also move the context-window component (context %) to immediately after the model on line 1 — model -> context -> directory -> git -> worktree -> cost -> session — so token usage stays glanceable next to what is consuming it. Docs (STATUSLINE.md, README.md, docs/features.md, CHANGELOG) and tests updated: added a label-only badge test in both suites and a line-1 order guard in the integration test. All 8 statusline suites pass, shellcheck clean.
Review: fix(statusline): account badge from label alone; context next to modelSmall, well-scoped PR — two independent fixes bundled with matching doc/test updates. Went through the diff, the surrounding Code quality / correctness
Test coverage
Docs
Security
Performance
Overall: clean root-cause fix, matching test updates, docs kept in sync. LGTM. |
Resolves two Dependabot alerts on the default branch: - pytest <9.0.3 — vulnerable tmpdir handling (moderate) - Pygments <2.20.0 — ReDoS via inefficient GUID-matching regex (low) Both are dev/transitive deps in uv.lock. Full suite (27 tests, 90 subtests), ruff, and pyright pass on the pytest 8->9 major bump.
|
Review Reviewed the diff between fee81aa and 5ec7b68 plus the surrounding statusline modules. This is a small, well-scoped, well-tested PR bundling two independent changes.
Security Nits / non-blocking
Verdict: LGTM. No blocking issues found; both behavioral changes are small, correctly scoped, and backed by tests that exercise the new behavior end-to-end rather than just the paths that already worked. |
…adge Addresses review nit — the 'driven entirely by CLAUDE_CODE_OAUTH_TOKEN' line could read as contradicting the new token-independent badge behavior.
|
Thanks for the review. Addressed the actionable nit and confirmed the rest:
|
ReviewReviewed the diff directly (test execution wasn't available in this sandbox, so this is based on static reading of the changed files + the full Code quality
Bugs / correctness
Test coverage
Security
OverallSmall, well-scoped, root-cause fix with matching doc updates and correctly-flipped test assertions. No blocking issues found. Only note is to confirm the pytest 9 bump is fully green in CI rather than just locally, since it's the one item in this bundle with a nonzero chance of subtle breakage unrelated to the statusline changes themselves. |
Summary
Two statusline fixes, bundled:
Account badge now renders without
CLAUDE_CODE_OAUTH_TOKEN. TheCLAUDE_STATUSLINE_ACCOUNT_LABELbadge was gated on the OAuth-token env var also being set (get_account_componentrequired both). Accounts switched via a separate credential store — e.g.alias claude2='CLAUDE_STATUSLINE_ACCOUNT_LABEL=alt CLAUDE_SECURESTORAGE_CONFIG_DIR=~/.claude-alt claude'— never set that token, so no badge showed. The label is user-set display text and now renders whenever it's set, independent of how the account was selected. Per-account cache isolation and background OAuth refresh remain keyed onCLAUDE_CODE_OAUTH_TOKEN(unchanged).Context moved next to the model on line 1. The context-window percentage (📊) now renders immediately after the model instead of after git/worktree, so token usage sits next to what's consuming it:
New default order: model → context → directory → git → worktree → cost → session.
Changes
lib/display/components.sh— badge guard now depends only on the label (root cause).lib/display/builder.sh— context component moved right after model.STATUSLINE.md,README.md,docs/features.md,CHANGELOG.md— docs updated to match.Tests
test_multi_account.sh,test_display_components.sh) covering theCLAUDE_SECURESTORAGE_CONFIG_DIRswitch case.🤖→📊→📁) to the integration test.make check/make test/ pre-commit green.Security
Also resolves the two Dependabot alerts on the default branch (bundled per request): pytest
<9.0.3(moderate, tmpdir handling) → 9.1.1, and Pygments<2.20.0(low, ReDoS) → 2.20.0, both dev/transitive deps inuv.lock. Full suite passes on the pytest 8→9 major bump.