Plugins can declare an optional short_name in fields_description for
compact label display in tight per-plugin renderers:
ctx_switches.short_name = 'ctx_sw'
soft_interrupts.short_name = 'sw_int'
interrupts.short_name = 'inter'
A new field_label(schema, field_name, prefer_short=False) helper
encapsulates the resolution order:
- prefer_short=True: short_name -> label -> field name
- prefer_short=False (default, generic renderer): label -> field name
The cpu render_curses_v5 now pulls every column label via
field_label(..., prefer_short=True) instead of hardcoding labels.
Mirrors v4 short_name (cf. curse_add_stat in plugins/plugin/model.py).
Documented in architecture decisions section 3.2 and SKILL-plugin.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three TUI/alerts corrections raised by the v4 visual review:
1. Column widths now floored to a per-unit minimum so cells don't jiggle
cycle-to-cycle:
percent 6 chars ('100.0%')
bytes 6 ('999.9G')
bytespers 8 ('999.9G/s')
seconds 6 ('1d23h ')
number 5
bool 3
An explicit `column_width` in fields_description still overrides.
cpu's bespoke 3-col grid uses the same approach with fixed value
columns of 6 chars.
2. _attr_for now applies A_REVERSE (background highlight) when a cell is
prominent AND carries any non-DEFAULT alert level (OK/CAREFUL/WARNING/
CRITICAL) — previously only WARNING and CRITICAL. Matches v4 behaviour
for *_LOG decorations on watched-prominent fields.
3. GlancesAlerts now skips ingestion for the first N refresh cycles per
plugin (default N=3, configurable via [alerts] warmup_cycles). Rates
and threshold-derived _levels can fire spuriously at startup before
the system has settled — this matches v4's behaviour of ignoring logs
during the same warmup. The TUI colouring is unaffected (it reads
_levels directly from the payload).
Test fixtures now default to warmup_cycles=0 so existing assertions
remain valid; three new tests cover the warmup behaviour explicitly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>