fix: hide empty-state copy on queue credential fail-closed (Closes #458)

When fetch_error is set, render only the unavailable banner and an
explicit not-fetched inventory note. Suppress queue tables, pagination
proof, and "No open items." copy that implied a successful empty fetch.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
2026-07-07 16:07:20 -04:00
co-authored by Claude Opus 4.8
parent ee8e9a0247
commit e6a0603fc3
2 changed files with 43 additions and 1 deletions
+12 -1
View File
@@ -72,6 +72,18 @@ def render_queue_page(snapshot: QueueSnapshot) -> str:
f'<div class="stub"><p><strong>Queue unavailable:</strong> '
f"{html.escape(snapshot.fetch_error)}</p></div>"
)
inventory_block = (
"<p class='muted'><strong>Inventory:</strong> not fetched "
"(fail closed — queue tables omitted).</p>"
)
return (
"<h2>Live queue</h2>"
f"<p class='meta'>Repository: <code>{html.escape(snapshot.repo_label)}</code> "
f"· project <code>{html.escape(snapshot.project_id)}</code></p>"
f"{error_block}"
f"{inventory_block}"
"<p class='muted'>Read-only MVP — claims, reviews, and merges stay in Gitea/MCP tools.</p>"
)
pr_section = _queue_table(
title="Open pull requests",
@@ -101,7 +113,6 @@ def render_queue_page(snapshot: QueueSnapshot) -> str:
"<h2>Live queue</h2>"
f"<p class='meta'>Repository: <code>{html.escape(snapshot.repo_label)}</code> "
f"· project <code>{html.escape(snapshot.project_id)}</code></p>"
f"{error_block}"
f"{_pagination_html('PR', snapshot.pr_pagination)}"
f"{pr_section}"
f"{_pagination_html('Issue', snapshot.issue_pagination)}"