Skip to content

feat: configurable HUD replacing bash statusline#155

Merged
dean0x merged 4 commits intomainfrom
feat/configurable-hud
Mar 22, 2026
Merged

feat: configurable HUD replacing bash statusline#155
dean0x merged 4 commits intomainfrom
feat/configurable-hud

Conversation

@dean0x
Copy link
Owner

@dean0x dean0x commented Mar 21, 2026

Summary

  • Replaces the bash statusline.sh with a configurable TypeScript HUD
  • 14 core components: directory, git branch, ahead/behind, diff stats, release info, worktree count, model, context usage, version badge, session duration, session cost, usage quota, todo progress, config counts
  • 3 new optional components: release-info, session-cost, worktree-count
  • Removed: speed, tool-activity, agent-activity (low value, high noise)
  • Simple on/off model — no preset picker, no configuration friction
  • Version badge always renders (even when HUD disabled) so users see upgrade notifications
  • --hud-only flag for standalone HUD install without plugins
  • Context-aware progress bar for usage quota (5h/7d windows)
  • 24h-cached version check via npm registry
  • Credentials helper for API key detection (usage quota)
  • All data gathered in parallel with 2s overall timeout

Test plan

  • npm run build — clean compile
  • npm test — 364/364 tests passing
  • devflow hud --status — shows enabled + 14 components
  • devflow hud --enable / --disable — toggle works
  • Version badge renders when outdated, hidden when current

Dean Sharon added 3 commits March 21, 2026 03:45
Replace scripts/statusline.sh with a configurable TypeScript HUD system
that supports 14 components across 4 presets (Minimal, Classic, Standard,
Full) with smart multi-line layout.

Core infrastructure:
- src/cli/hud/ — types, config, stdin, colors, git, transcript, cache,
  usage-api, render, and index (entry point with 2s timeout)
- 14 component files in src/cli/hud/components/
- scripts/hud.sh shell wrapper + scripts/build-hud.js distribution

CLI integration:
- devflow hud --configure/--preset/--status/--enable/--disable
- Init phase: HUD preset picker between memory and security
- Uninstall: HUD statusLine cleanup
- List: shows HUD preset in features

Settings:
- Template updated: statusline.sh -> hud.sh
- addHudStatusLine/removeHudStatusLine/hasHudStatusLine pattern
- Automatic upgrade from legacy statusline.sh
- Conflict detection for non-DevFlow statusLine

Tests: 68 new tests across 3 test files (341 total, all passing)
…naries, reduce duplication

- Consolidate readCache/readCacheStale into shared readCacheEntry helper
- Replace nested ternaries with if/else chains in context-usage and usage-quota
- Remove dead `=== undefined` check in usage-quota (nullish coalescing never produces undefined)
- Simplify agent-activity loop by extracting icon/colorFn before push
- Merge duplicate HUD settings.json branches in init.ts (add/remove unified)
- Consolidate three separate settings.json writes into single pass in uninstall.ts
- Reuse existing settingsPath variable instead of redeclaring hudSettingsPath
- Use const for sessionStartTime (conditional expression instead of let + if)
- Replace dynamic import('node:path') with static import in index.ts
- Use homedir() instead of '~' literal for reliable home directory fallback
- Tighten isDevFlowStatusLine matching to avoid false positives on partial substrings
- Reduce API_TIMEOUT from 15s to 1.5s to fit within 2s overall HUD timeout
- Remove unused GitStatus import from hud-render.test.ts
@dean0x dean0x force-pushed the feat/configurable-hud branch 2 times, most recently from c749439 to af807c3 Compare March 21, 2026 23:58
Replace 4-preset system (minimal/classic/standard/full) with a single
component list. HUD is now on or off — no preset picker in init flow.

- Collapse PRESETS into HUD_COMPONENTS (14 components)
- Simplify HudConfig to { enabled, detail }
- Remove --configure, --preset, --hud <preset> flags
- Init flow: p.confirm("Enable HUD?") instead of 5-option selector
- --hud-only installs directly without preset question
- --disable keeps statusLine registered (version badge still renders)
- Version badge always included so upgrade notifications show even
  when HUD is disabled
- Remove agent-activity, speed, tool-activity components
- Add release-info, session-cost, worktree-count components
- Manifest hud field: string|false → boolean
@dean0x dean0x force-pushed the feat/configurable-hud branch from af807c3 to 578a08a Compare March 22, 2026 00:02
@dean0x dean0x merged commit 6b4a4fc into main Mar 22, 2026
1 check failed
@dean0x dean0x deleted the feat/configurable-hud branch March 22, 2026 00:04
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