Skip to content

feat(ui): add per-row throughput trend sparkline column - #745

Open
domcyrus wants to merge 4 commits into
mainfrom
feat/connection-trend-sparkline
Open

domcyrus wants to merge 4 commits into
mainfrom
feat/connection-trend-sparkline

Conversation

@domcyrus

@domcyrus domcyrus commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds an 8-second per-row Trend throughput sparkline column to the shared connection tables (Overview, grouped view, and the Details continuity strip).

  • UI-side sampling (src/ui/trend.rs): TrendHistory samples live connections once per second by diffing cumulative bytes_received / bytes_sent counters, preserving per-second burst shape instead of flattening it into the 10s sliding average and without copying RateTracker's raw sample buffers. Member deltas are also summed per process group so group headers render aggregate trends cleanly without spikes when connections open or close.
  • Visual encoding: 8 cells of eighth-block bars (▁..█, newest on the right, · for silent seconds), scaled to each row's peak with a 1 KiB/s floor so trickles stay low. Bars use the Graph tab's rx_wave / tx_wave gradients based on dominant direction; under NO_COLOR, bar height carries the shape on its own.
  • Selected-row legibility: On themes that highlight selected rows with REVERSED (Muted, Vivid, ANSI-16, NO_COLOR), strips REVERSED | BOLD from non-blank Trend cells so block glyphs stay right-side-up and in their true colors (keeping blank historic cells reversed so the highlight band stays continuous). On tinted-selection themes, lifts idle dots from faint to muted on the selected row.
  • Responsive layout: Placed right before Rx↓/Tx↑, unsortable, and hidden automatically on narrow terminals (degradation order: Location → Service → Trend → Local → RTT → Health → compact App → State). Historic rows and historic-only groups leave the cell blank.
  • Lifecycle & help: Clears trend history on x (clear all connections) and documents the Trend column in the Help legend.

Verification

Verified via CI on commit e503ac1b (all 30 checks passing across Linux, macOS, Windows, 32-bit parser, Docker, and CodeQL):

  • cargo fmt --all -- --check
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
  • cargo test --locked --workspace --all-features
  • cargo build --locked --workspace --all-targets --release

Scope

  • One feature or fix per PR (no unrelated cleanups bundled in)
  • I reviewed the changes and the description matches the diff
  • No new dependencies
  • No #[allow(clippy::...)] suppressions
  • User-visible changes are added to the ## [Unreleased] section of CHANGELOG.md

@domcyrus
domcyrus marked this pull request as ready for review November 23, 2026 17:11
@domcyrus
domcyrus force-pushed the feat/connection-trend-sparkline branch from 7fd3f0b to 3ea284b Compare November 25, 2026 21:06
@domcyrus
domcyrus force-pushed the feat/connection-trend-sparkline branch from 3ea284b to 9379792 Compare November 25, 2026 21:07
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