Skip to content

feat: environment widget, auto-wrap, adaptive detail, usage reset countdown#292

Open
renaissance-dan wants to merge 29 commits intosirmalloc:mainfrom
renaissance-dan:main
Open

feat: environment widget, auto-wrap, adaptive detail, usage reset countdown#292
renaissance-dan wants to merge 29 commits intosirmalloc:mainfrom
renaissance-dan:main

Conversation

@renaissance-dan
Copy link
Copy Markdown

About the diff size

This PR is ~9,700 lines but most of that isn't new. The breakdown:

Source Lines %
Your feature/activityWidgets branch (merged in as a dependency) ~8,500 87%
New files (environment widget, detail-level, plugin, tests) ~750 8%
Modifications to existing files (auto-wrap, adaptive detail, usage timers) ~500 5%

If you'd prefer a PR scoped to just the new features targeting feature/activityWidgets instead of main, happy to restructure.

New features (our ~1,250 lines)

Environment widget — shows counts of loaded CLAUDE.md files, MCP servers, rules, and hooks. Hides when all counts are zero. Follows existing widget patterns (rawValue, maxWidth, ActivityWidthEditor, custom keybinds). Config counting logic ported from claude-hud.

Auto-wrap — when widgets on a line exceed terminal width, they wrap to the next line at separator boundaries instead of truncating with .... Leading/trailing separators are dropped on wrapped lines. Controlled by autoWrap setting (default: true). Standard mode only — powerline unchanged.

Adaptive detail levels — widgets adjust verbosity based on terminal width. Wide (>=100 cols): full labels, 16-char progress bars, token counts. Medium (>=60): compact 8-char bars, short labels. Narrow (<60): text-only percentages. Applies to ContextBar, SessionUsage, WeeklyUsage, Model, GitBranch, Environment.

Usage reset countdown — SessionUsage and WeeklyUsage widgets now show time until reset (e.g., "resets 2hr 15m"). Note: the stdin rate_limits fallback itself already exists in main via #253 — this just adds the countdown display.

Plugin structure.claude-plugin/ manifest and commands/ for /ccstatusline:setup and /ccstatusline:configure slash commands.

New files

  • src/utils/environment-counter.ts — config counting utility
  • src/utils/detail-level.ts — detail level utility
  • src/widgets/Environment.ts — Environment widget
  • src/widgets/__tests__/Environment.test.ts
  • src/utils/__tests__/environment-counter.test.ts
  • .claude-plugin/plugin.json — Claude Code plugin manifest
  • commands/setup.md/ccstatusline:setup slash command
  • commands/configure.md/ccstatusline:configure slash command

Tests

  • 628 pass, 0 fail
  • Build clean, lint clean

sirmalloc and others added 29 commits March 3, 2026 02:13
Combines the 55 upstream/main commits with the activity widgets branch.
Resolved conflicts by merging both feature sets: activity widgets (tools,
agents, todo, activity) from the feature branch with speed, skills,
thinking-effort, vim-mode widgets from main. Switched to Map-based widget
registry pattern from the activity branch.
The BlockResetTimerWidget is registered as 'reset-timer' (matching
upstream/main's widget-manifest), not 'block-reset-timer'.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…isplay

When the API is unavailable (e.g. Claude Max plans with no API key),
SessionUsage and WeeklyUsage now read rate_limits from stdin JSON.
Reset timers show remaining time until the usage window resets.
formatUsageDuration extended to support day-scale durations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests for ContextBar, GitBranch, and Environment widgets need explicit
terminalWidth: 160 to get wide-mode output, matching pre-detail-level
expected values.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Enables users to install ccstatusline via:
  claude plugin marketplace add renaissance-dan/ccstatusline
  claude plugin install ccstatusline

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Setup skill now validates the binary exists and executes before writing
config, checks if an existing statusLine is already working before
overwriting, and prioritizes local plugin path over cache.

Added `prepare` script so dist/ gets built automatically after git
clone + install, fixing the issue where cached plugins have source
but no build artifacts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants