summaryrefslogtreecommitdiff
path: root/internal/display/tooltip.go
AgeCommit message (Collapse)Author
2026-02-18feat: add disk I/O stats (read/write throughput bars, hotkey 5, auto-scale)Paul Buetow
Add a new disk stats category that reads /proc/diskstats, shows read/write throughput as colored bars (purple/darker purple like network RX/TX), with optional utilization % overlay in extended mode. Hotkey 5 cycles: aggregate (sum all whole-disk devices) → per-device → off. Auto-scale with decay and optional fixed override via --diskmax / diskmax config key. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18refactor: enforce Go best practices (function size, ordering, formatting)Paul Buetow
- config: split set() (62L) into setSizeAndTuning() + setDisplayFlags() - collector: split Run() (70L) into Run + startLocalScanner + startRemoteScanner + parseCollectorStream + dispatchCollectorLine; each <30L - collector: remove unused script_embed.go (RemoteScript was dead code) - display: move newRunState constructor before Run() per constructor-first rule - display: replace loadPeak IIFE with a plain initLoadPeak variable - display: split handleKey() (114L) into handleToggleKeys + handleAdjustAndSave + handleResizeKeys; add nil guard in handleResizeKeys for test safety - display: split drawNetBarSmoothed() (75L) into drawNetBarSmoothed + smoothNetUtilization + drawNetHalves; each <30L - all: gofmt -w to fix formatting drift in display and config files All tests pass (go test ./...). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18feat: add fixed load scale (--loadmax), load peak reset (r key), update READMEPaul Buetow
- config: add LoadMax float64 field; loadmax key in ~/.loadbarsrc; written by 'w' - main: add --loadmax flag (overrides rc file when > 0) - display: newRunState initialises loadPeak from LoadMax when fixed - display: updateLoadPeak accepts loadMax param; short-circuits to fixed value when set - display: add 'r' hotkey to reset auto-scale peak to floor (2.0); no-op when fixed - tooltip: loadTooltipLines shows 'Max:' label when scale is fixed, 'Peak:' for auto - README: document 4/l load toggle, r reset, --showload, --loadmax, load average bars section; fix --cpumode entry Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18feat: add load average bar visualization (4/l hotkey)0.12.0Paul Buetow
Adds a new teal bar type showing /proc/loadavg data per host. The 1-min average fills from the top downward; yellow and white 1px reference lines mark the 5-min and 15-min averages. A global loadPeak tracker (floor 2.0, slow per-frame decay) keeps the scale meaningful across hosts and after spikes. Toggle with 4 or l; persisted to ~/.loadbarsrc as showload=1. Bump version to 0.12.0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18feat: triple-toggle CPU display mode via 1 key; add tooltip, font, hit-testPaul Buetow
CPU display now cycles through three states with each press of 1: 0 = CPUModeAverage – aggregate bar only (default) 1 = CPUModeCores – individual core bars + aggregate 2 = CPUModeOff – all CPU bars hidden Config file stores cpumode=N (integer); old showcores=0/1 is read for backward compatibility. CLI flag --showcores replaced by --cpumode. Other improvements landed in this commit: - internal/display: add font.go (text rendering), hittest.go (bar hit testing), tooltip.go (mouse-over tooltip), tooltip_test.go - internal/display: mouse tracking and drawOverlay hook in display.go - internal/display: update build tags to //go:build form - internal/collector: embed remote script via script_embed.go / scriptdata/loadbars-remote.sh - internal/collector: CPULine.Total() changed to value receiver - internal/collector: table test improvements (name field, t.Run) - internal/constants: BytesPerSec consts promoted from var to const - Magefile.go: fix error formatting and install path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>