v0.1.2
Internal cleanup: no behavior change and no new features. Reduces duplication,
splits an oversized file, tightens package seams, and makes the interactive code
testable (total coverage 66.9% → 73.7%).
Changed
- Shared UI helpers — moved the duplicated
setColor,clampAll,
firstLine, and colour-threshold logic out ofdashboardandfleetinto the
tuitoolkit (SetColorMode,ClampAll,FirstLine,ThreshColor). No
behavior change; both views now share one source of truth for colour and
layout. - Split
dashboard.go— the 1200-line file is now four focused files in the
same package:dashboard.go(lifecycle + data),input.go(keys/actions),
render.go(view builders), andformat.go(pure formatting helpers). Pure
code move, no behavior change. - Unified the SSH seam —
dashboard.Clientis now an alias of
metrics.Runner, so the dashboard and the metrics collector share one
interface instead of two identical copies. - Split
tui.ListintoList+Pager— the selectable list and the
scrollable overlay were one dual-mode type gated by aselectableflag;
they are now two focused widgets (List.Render(w, h)drops the flag), which
removes the never-used pager branch from the list path. - Raised
sshxcoverage from ~48% to ~72% with white-box tests for the
non-interactive helpers (termType,classifyDialError,contains,
appendKnownHost,confirmHost, and thehostKeyCallbackpinning/rejection
paths). The remaining gap is interactive (Shell, terminal read). - Testability seams — extracted terminal-independent cores so the
interactive paths can be tested without a real TTY, with no behavior change:
the host-key TOFU prompt (confirmHost), the key passphrase decrypt path
(parseSigner), and the dashboard/fleet event loops (loop, driven by an
injectedscreeninterface and input/signal/tick channels). Total coverage
rose from ~67% to ~74% (dashboard 80%, fleet 62%, sshx 72%, keys 77%).