Skip to content

Commit 349a030

Browse files
fix(banner): strip leading pad and large gap between units (#46)
Leading pad (w//2 spaces) and inter-unit gap (w//3 spaces) were originally needed when banners were discrete. The tape now streams the next banner in seamlessly so both are dead space. Collapsed to a fixed 4-space separator in _build_unit and _banner_unit_len. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e106bd4 commit 349a030

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

.console/log.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
_Chronological continuity log. Decisions, stop points, what changed and why._
44
_Not a task tracker — that's backlog.md. Keep entries concise and dated._
55

6+
- Banner padding stripped (2026-05-08, on fix/banner-strip-padding): Removed leading pad (`(w-1)//2` spaces) and large gap (`max(12, (w-1)//3)` spaces) from `_build_unit` and `_banner_unit_len`. Both cases now use a fixed 4-space separator between units — the tape streams the next banner in seamlessly so the large pads were dead space.
7+
68
- Multi-banner cycling system + white-on-red fix (2026-05-08, on feat/multi-banner-cycle): The single-purpose stall banner becomes a 4-level banner system. CRITICAL (white on red — fixes the previous black-on-red look from A_REVERSE), WARNING (white on yellow), INFO (white on cyan), HEALTHY (white on green). Conditions: CRITICAL = stall / SwitchBoard offline / resource gate at cap or below RAM floor. WARNING = backend at concurrency cap / queue depth ≥ 10 / free RAM within 1.2× of gate floor. INFO = first 30s after launch (readings stabilizing). HEALTHY = nothing else. Worst-first sort; cycle index advances every 15 frames (3s at 200ms tick); marquee restarts when cycling. Counter shown on banner when count > 1 ([N/M]). Banner block always renders so layout stays stable; middle_top fixed at 7. 8 new tests in TestBannerConditions; 26 watcher tests passing.
79

810
- Banner + footer divider lines (2026-05-08, on feat/banner-and-footer-dividers): Two visual changes. Top: when stall banner is up, layout becomes divider/marquee/divider/blank/title (was marquee/blank/title/blank/divider) — the two dividers frame the alert as its own block. Bottom: footer block now divider/hints/divider going up from the bottom edge (was just hints), with the existing trailing blank from System Resources sitting above the upper divider. Flash floats above the upper divider when present. middle_top=5 with banner / 3 without; footer_h=4 with flash / 3 without.

src/operator_console/watcher_status_pane.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,13 +1208,7 @@ def _banner_unit_len(message: str, banner_count: int, banner_index: int, w: int)
12081208
"""
12091209
counter = f" [{banner_index + 1}/{banner_count}]" if banner_count > 1 else ""
12101210
payload = f" {message}{counter} "
1211-
if banner_count > 1:
1212-
gap = " " * max(12, max(1, (w - 1)) // 3)
1213-
leading_pad = " " * (max(1, w - 1) // 2)
1214-
else:
1215-
gap = " "
1216-
leading_pad = ""
1217-
return len(leading_pad) + len(payload) + len(gap)
1211+
return len(payload) + 4
12181212

12191213

12201214
def _wrap_hints(chunks: tuple[str, ...], width: int) -> list[str]:
@@ -1284,13 +1278,7 @@ def _build_unit(b_severity: str, b_message: str, b_idx: int) -> tuple[str, str]:
12841278
"""Return (full_unit_text, severity) for one banner condition."""
12851279
ctr = f" [{b_idx + 1}/{banner_count}]" if banner_count > 1 else ""
12861280
payload = f" {b_message}{ctr} "
1287-
if banner_count > 1:
1288-
g = " " * max(12, (w - 1) // 3)
1289-
lp = " " * ((w - 1) // 2)
1290-
else:
1291-
g = " "
1292-
lp = ""
1293-
return lp + payload + g, b_severity
1281+
return payload + " ", b_severity
12941282

12951283
severity, message = current_banner
12961284
cur_unit, cur_sev = _build_unit(severity, message, banner_index)

0 commit comments

Comments
 (0)