fix: guard dashboard health panel

This commit is contained in:
Andrii Prokhorov
2025-11-21 18:09:06 +02:00
parent 303258a6bb
commit 4873777ba8

View File

@@ -293,8 +293,10 @@ class ReactorDashboard:
return row + 1
def _draw_health_bar(self, win: "curses._CursesWindow", start_y: int) -> None:
win.addstr(start_y, 2, "Component Health", curses.A_BOLD | curses.color_pair(1))
height, width = win.getmaxyx()
if start_y >= height - 2:
return
win.addstr(start_y, 2, "Component Health", curses.A_BOLD | curses.color_pair(1))
bar_width = max(10, min(width - 28, 40))
for idx, (name, comp) in enumerate(self.reactor.health_monitor.components.items(), start=1):
filled = int(bar_width * comp.integrity)