INNER CODE UNIT · Python
refresh_escs
VisionForge-OU/foreman · src/foreman/tui/app.py:291
def refresh_escs(self) -> None:
# The resume worker calls this AFTER its (long) await, by which point the user
# may have navigated away and this screen been torn down. `is_mounted` is
# unreliable here, so check for the widget directly and bail if it's gone.
if not self.query("#elist"):
return
escs = self.app.controller.escalations(self.slug)
lv = self.query_one("#elist", ListView)
lv.clear()
for iid, reason in escs:
lv.append(ListItem(Label(f"{iid}: {reason[:60]}"), name=iid))
if escs and self.selected is None:
self.selected = escs[0][0]
self._show_detail()
def _show_detail(self) -> None:
detail = self.query_one("#detail", Static)
if not self.selected: