Commit Graph

2 Commits

Author SHA1 Message Date
nicolargo
eddad9a7b8 fix(v5): network — shrink name col so Tx/s isn't clipped by sidebar cap
Block width was 36 chars (name=20 + gap + rx=7 + gap + tx=7) but the
left sidebar is capped at 34 chars (`_left_sidebar_max_width=34`),
clipping the last 2 chars of the Tx/s column (`Tx/s` → `Tx`, `19.0Kb`
→ `19.0`).

Reduces `_NAME_MAX_WIDTH` from 20 to 18 so the natural row width is
exactly 34, fitting the sidebar without painter-side clipping.

Adds a regression test asserting every rendered row fits in 34 chars.
2026-05-15 09:52:16 +02:00
nicolargo
57c0f80005 feat(v5): network render_curses_v5 — Rx/s + Tx/s per-interface block
Replicates v4 ``network.msg_curse()`` default mode (rate display, bits,
two columns):

    NETWORK              Rx/s    Tx/s
    eth0                 1.1Mb  250.0Kb
    wlp0s20f3           43.9Kb   11.7Kb
    lo                      0b      0b

- Header line ``NETWORK | Rx/s | Tx/s`` with dynamic title color escalation
  from any prominent bytes_recv/bytes_sent _level (warning/critical).
- One row per interface; ``is_up=False`` and first-cycle interfaces
  (no rate yet) are filtered out (v4 issues #765 + on-the-fly creation).
- Rate values: bytes/s × 8 → bits/s, K/M/G/T scaled, ``b`` suffix; sub-K
  values stay raw (e.g. ``0b``) — matches v4 ``auto_unit + 'b'``.
- Long interface names tail-truncated with a leading underscore.
- Per-interface ``_levels`` drive rate cell color + prominent flag.

Hardcoded ``name_max_width=20`` and rate-bits-2col mode for G1. TODO
in the module documents the plumbing needed (max_width + args) to
support --byte / --network-cumul / --network-sum in G2+.

16 new tests in tests/test_plugin_network_render_curses_v5.py.
2026-05-15 09:43:50 +02:00