Show degraded status for fallback dashboard context #98

Merged
rockachopa merged 1 commits from timmy/97-show-degraded-fallback-context into main 2026-08-06 10:47:59 +00:00
2 changed files with 8 additions and 1 deletions

View File

@ -216,7 +216,7 @@ textarea { resize: vertical; min-height: 120px; }
'<div class="muted">' + escapeHtml(p.state) + ' by ' + escapeHtml(String(p.user || '')) + '</div></div>').join('') : '<div class="muted">No PRs.</div>');
paintDeltas(data.deltas || []);
setStatus('Live · updated just now');
setStatus(data.error ? 'Degraded · ' + data.error : 'Live · updated just now');
setClock();
} catch (e) {
console.error('context failed', e);

View File

@ -9,3 +9,10 @@ async def test_dashboard_renders_repo_mix_placeholder_before_javascript_runs():
server_rendered_html = html.split("<script>", 1)[0]
assert '<div class="small" id="repo-mix">Loading…</div>' in server_rendered_html
@pytest.mark.anyio
async def test_dashboard_marks_fallback_context_as_degraded_instead_of_live():
html = await dashboard()
assert "data.error ? 'Degraded · ' + data.error : 'Live · updated just now'" in html