From d7bec41ac861978b4eabe7892f4369b8273d121b Mon Sep 17 00:00:00 2001 From: cyc Date: Tue, 10 Nov 2026 10:02:12 +0800 Subject: [PATCH 1/2] feat(statusline): ship the compact ccstatusline layout (#416) Row 1 is now `model (effort) | Ctx | Usage: 7d ` and row 2 is `cwd | git-branch | git-changes`. Drop the Total (tokens/cost) group, the 5h usage widgets and the compaction counter, and shorten the Context label to Ctx. On a Max 20x plan there is no 5h window, so those widgets only rendered [Timeout] / [Rate limited] after falling back to the OAuth usage API. ccstatusline 2.2.19 has no per-plan show/hide option, so the layout is fixed at template level. Add a CHANGELOG [Unreleased] entry. --- doc/changelog/CHANGELOG.md | 9 +++++ .../config/claude/ccstatusline.settings.json | 34 ++++++------------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/doc/changelog/CHANGELOG.md b/doc/changelog/CHANGELOG.md index 5e545c24..eb922eef 100644 --- a/doc/changelog/CHANGELOG.md +++ b/doc/changelog/CHANGELOG.md @@ -322,6 +322,15 @@ not deferred to release. `release-tag.sh` promotes `[Unreleased]` → ### Changed +- **Compact ccstatusline layout** (`module/config/claude/ccstatusline.settings.json`, + refs #416). Row 1 is now `model (effort) | Ctx | Usage: 7d ↻ + ` and row 2 is `cwd | git-branch | git-changes`. Dropped the + `Total: ()` group, the 5h usage widgets (`session-usage`, + `reset-timer`; a Max 20x plan has no 5h window, so they only rendered + `[Timeout]` / `[Rate limited]`) and the compaction counter, and shortened the + `Context: ` label to `Ctx `. ccstatusline 2.2.19 has no per-plan show/hide + option, so the layout is fixed at template level. No script or deploy-path + change; the existing `claude-code-config` specs only assert `version == 3`. - **yazi no longer renders/previews PDFs** (`module/config/yazi/yazi.toml`). Removed the two `{ mime = "application/pdf", run = "pdf" }` rules from the `[plugin]` `preloaders` and `previewers` lists so PDF files fall through to diff --git a/module/config/claude/ccstatusline.settings.json b/module/config/claude/ccstatusline.settings.json index 4e4ef530..578d460a 100644 --- a/module/config/claude/ccstatusline.settings.json +++ b/module/config/claude/ccstatusline.settings.json @@ -2,40 +2,26 @@ "version": 3, "lines": [ [ - { "id": "1", "type": "current-working-dir", "color": "blue", "metadata": { "fishStyle": "true" } }, - { "id": "2", "type": "separator" }, - { "id": "10", "type": "git-branch", "color": "magenta", "metadata": { "hideNoGit": "true" } }, - { "id": "11", "type": "separator" }, - { "id": "12", "type": "git-changes", "color": "yellow", "metadata": { "hideNoGit": "true" } }, - { "id": "48", "type": "separator" }, { "id": "3", "type": "model", "color": "cyan", "rawValue": true }, { "id": "4", "type": "custom-text", "color": "brightBlack","customText": " (" }, { "id": "5", "type": "thinking-effort", "color": "cyan", "rawValue": true }, { "id": "47", "type": "custom-text", "color": "brightBlack","customText": ")" }, - { "id": "6", "type": "separator" }, - { "id": "31", "type": "custom-text", "color": "brightBlack","customText": "Total: " }, - { "id": "15", "type": "tokens-total", "color": "white", "rawValue": true }, - { "id": "32", "type": "custom-text", "color": "brightBlack","customText": " (" }, - { "id": "30", "type": "session-cost", "color": "green", "rawValue": true }, - { "id": "33", "type": "custom-text", "color": "brightBlack","customText": ")" } - ], - [ - { "id": "28", "type": "custom-text", "color": "brightBlack","customText": "Context: " }, + { "id": "51", "type": "separator" }, + { "id": "28", "type": "custom-text", "color": "brightBlack","customText": "Ctx " }, { "id": "17", "type": "context-percentage", "color": "white", "rawValue": true }, - { "id": "34", "type": "custom-text", "color": "brightBlack","customText": " (" }, - { "id": "25", "type": "compaction-counter", "color": "yellow", "metadata": { "format": "number" } }, - { "id": "35", "type": "custom-text", "color": "brightBlack","customText": ")" }, { "id": "45", "type": "separator" }, - { "id": "36", "type": "custom-text", "color": "brightBlack","customText": "Usage: 5h " }, - { "id": "37", "type": "session-usage", "color": "yellow", "rawValue": true }, - { "id": "49", "type": "custom-text", "color": "cyan", "customText": " ↻ " }, - { "id": "19", "type": "reset-timer", "color": "cyan", "rawValue": true }, - { "id": "38", "type": "custom-text", "color": "brightBlack","customText": " · 7d " }, + { "id": "38", "type": "custom-text", "color": "brightBlack","customText": "Usage: 7d " }, { "id": "21", "type": "weekly-usage", "color": "yellow", "rawValue": true }, { "id": "50", "type": "custom-text", "color": "cyan", "customText": " ↻ " }, { "id": "41", "type": "weekly-reset-timer", "color": "cyan", "rawValue": true } ], - [] + [ + { "id": "1", "type": "current-working-dir", "color": "blue", "metadata": { "fishStyle": "true" } }, + { "id": "2", "type": "separator" }, + { "id": "10", "type": "git-branch", "color": "magenta", "metadata": { "hideNoGit": "true" } }, + { "id": "11", "type": "separator" }, + { "id": "12", "type": "git-changes", "color": "yellow", "metadata": { "hideNoGit": "true" } } + ] ], "flexMode": "full", "compactThreshold": 60, From 81d3fe1d36bfdd7e614ba66af2464099fe2ef1d9 Mon Sep 17 00:00:00 2001 From: cyc Date: Tue, 10 Nov 2026 10:09:44 +0800 Subject: [PATCH 2/2] test(statusline): update the layout specs for the compact ccstatusline layout (#416) The three claude-code-config specs that pinned the old layout (three rows with a trailing empty row, cwd/git on row 1, reset timers on row 2) failed against the new template. Assert the new shape instead: two rows, cwd then git on row 2, and row 1 carrying model, context and weekly usage while the 5h, Total and compaction-counter widgets stay out. Correct the CHANGELOG entry, which claimed the specs only check version 3. --- doc/changelog/CHANGELOG.md | 3 +- test/unit/module/claude-code-config_spec.bats | 29 +++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/doc/changelog/CHANGELOG.md b/doc/changelog/CHANGELOG.md index eb922eef..b3db56f7 100644 --- a/doc/changelog/CHANGELOG.md +++ b/doc/changelog/CHANGELOG.md @@ -330,7 +330,8 @@ not deferred to release. `release-tag.sh` promotes `[Unreleased]` → `[Timeout]` / `[Rate limited]`) and the compaction counter, and shortened the `Context: ` label to `Ctx `. ccstatusline 2.2.19 has no per-plan show/hide option, so the layout is fixed at template level. No script or deploy-path - change; the existing `claude-code-config` specs only assert `version == 3`. + change; the three layout specs in `test/unit/module/claude-code-config_spec.bats` + were updated to assert the new rows (and the removed widgets staying out). - **yazi no longer renders/previews PDFs** (`module/config/yazi/yazi.toml`). Removed the two `{ mime = "application/pdf", run = "pdf" }` rules from the `[plugin]` `preloaders` and `previewers` lists so PDF files fall through to diff --git a/test/unit/module/claude-code-config_spec.bats b/test/unit/module/claude-code-config_spec.bats index af410404..f4f1091f 100644 --- a/test/unit/module/claude-code-config_spec.bats +++ b/test/unit/module/claude-code-config_spec.bats @@ -407,25 +407,30 @@ _ccs_json="${MODULE_DIR}/config/claude/ccstatusline.settings.json" assert_success } -@test "ccstatusline.settings.json has the two-row layout (+ trailing empty row)" { - run jq -e '(.lines | length) == 3 +@test "ccstatusline.settings.json has the two-row layout (no trailing empty row)" { + run jq -e '(.lines | length) == 2 and (.lines[0] | length) > 0 - and (.lines[1] | length) > 0 - and (.lines[2] | length) == 0' "${_ccs_json}" + and (.lines[1] | length) > 0' "${_ccs_json}" assert_success } -@test "ccstatusline.settings.json row 1 leads with cwd then git (reordered layout)" { - run jq -e '.lines[0][0].type == "current-working-dir" - and .lines[0][2].type == "git-branch"' "${_ccs_json}" +@test "ccstatusline.settings.json row 2 leads with cwd then git (#416)" { + run jq -e '.lines[1][0].type == "current-working-dir" + and .lines[1][2].type == "git-branch"' "${_ccs_json}" assert_success } -@test "ccstatusline.settings.json row 2 inlines reset timers (no separate Reset row)" { - run jq -e '[.lines[1][].type] as $t - | ($t | index("context-percentage")) != null - and ($t | index("reset-timer")) != null - and ($t | index("weekly-reset-timer")) != null' "${_ccs_json}" +@test "ccstatusline.settings.json row 1 shows model, context and weekly usage only (#416)" { + run jq -e '[.lines[0][].type] as $t + | ($t | index("model")) != null + and ($t | index("context-percentage")) != null + and ($t | index("weekly-usage")) != null + and ($t | index("weekly-reset-timer")) != null + and ($t | index("session-usage")) == null + and ($t | index("reset-timer")) == null + and ($t | index("tokens-total")) == null + and ($t | index("session-cost")) == null + and ($t | index("compaction-counter")) == null' "${_ccs_json}" assert_success }