diff --git a/autohands/board.py b/autohands/board.py index 24eab4fd..c1f21f6d 100644 --- a/autohands/board.py +++ b/autohands/board.py @@ -559,7 +559,10 @@ def _render_html(snapshot: dict) -> str: if gh_owner and gh_repo else []) panel = t_.orchestration_panel( "hands", "", "", CHECKIN_PROMPT.format(owner=gh_owner or "the organism’s"), - work_links=work_links, organ="hands") + work_links=work_links, organ="hands", + refreshed_at=snapshot.get("generated") if not snapshot.get("errors") else None, + refresh_url=(f"https://github.com/{gh_owner}/{gh_repo}/actions/workflows/release_board.yml" + if gh_owner and gh_repo else None)) github_link = (f' · GitHub Page' if gh_owner and gh_repo else "") diff --git a/tests/test_board.py b/tests/test_board.py index 8eea7610..a1abae84 100644 --- a/tests/test_board.py +++ b/tests/test_board.py @@ -339,3 +339,15 @@ def test_orchestration_without_remote_reports_unknown_destination(): assert "https://github.com/None/None" not in page assert 'data-orchestration-copy' in page assert 'manage the organism’s release work' in page + + +def test_panel_refresh_uses_capture_not_release_time(monkeypatch): + theme = board.theme() + calls = [] + monkeypatch.setattr(theme, "orchestration_panel", lambda *a, **kw: calls.append(kw) or "") + board.render(SNAP, "html") + assert calls[0]["refreshed_at"] == SNAP["generated"] + assert calls[0]["refresh_url"] == "https://github.com/SomeOrg/SomeHands/actions/workflows/release_board.yml" + + board.render({**SNAP, "errors": ["release collection unavailable"]}, "html") + assert calls[-1]["refreshed_at"] is None