diff --git a/src/reactor_sim/dashboard.py b/src/reactor_sim/dashboard.py index a29b35b..bbf09a8 100644 --- a/src/reactor_sim/dashboard.py +++ b/src/reactor_sim/dashboard.py @@ -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)