diff --git a/autohands/board.py b/autohands/board.py index c1f21f6d..4f390f85 100644 --- a/autohands/board.py +++ b/autohands/board.py @@ -548,8 +548,10 @@ def _render_html(snapshot: dict) -> str: f"render:
") heart = _heart_board_url(snapshot) hero = t_.hero(BOARD_KEY, "Dashboard", _LEDE, navigation=[ - {"href": "#libraries", "label": "Libraries"}, - {"href": "#release-train", "label": "Release train"}, + {"href": "#libraries", "label": "Libraries", + "count": len(snapshot["libraries"]) if snapshot.get("libraries") is not None and not snapshot.get("errors") else None}, + {"href": "#release-train", "label": "Release train", + "count": len(snapshot["train"][:TRAIN_RUNS_SHOWN]) if snapshot.get("train") is not None and not snapshot.get("errors") else None}, ]) # The way back from the Pages board to the repository front door; owner # and repo come from the snapshot (the git remote), so nothing is @@ -566,7 +568,7 @@ def _render_html(snapshot: dict) -> str: github_link = (f' · GitHub Page' if gh_owner and gh_repo else "") - return f""" + return t_.section_layout(f"""') assert board.theme().prompt_heading("hands", heading_id="orchestration-hands-heading") in page for _, payload in board.ACTION_CHIPS: @@ -351,3 +351,10 @@ def test_panel_refresh_uses_capture_not_release_time(monkeypatch): board.render({**SNAP, "errors": ["release collection unavailable"]}, "html") assert calls[-1]["refreshed_at"] is None + + +def test_failed_collection_does_not_claim_zero_items_in_section_counts(): + snapshot = dict(SNAP, libraries=[], train=[], errors=['Collection unavailable']) + page = board._render_html(snapshot) + nav = re.search(r'