fix: remove fabricated fallback work items (#105)
This commit is contained in:
parent
acc60d11e7
commit
bfdc042e38
|
|
@ -222,24 +222,12 @@ textarea { resize: vertical; min-height: 120px; }
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('context failed', e);
|
console.error('context failed', e);
|
||||||
liveMode = false;
|
liveMode = false;
|
||||||
setStatus('Mock');
|
setStatus('Unavailable');
|
||||||
qs('#context').innerHTML = '<div class="kv"><div class="label">User</div><div class="value">Timmy Jr</div><div class="label">Repos</div><div class="value">3</div><div class="label">Issues</div><div class="value">—</div><div class="label">PRs</div><div class="value">—</div></div>';
|
qs('#context').innerHTML = '<div class="muted">Context unavailable.</div>';
|
||||||
qs('#view-hint').textContent = 'Active view: dashboard';
|
qs('#view-hint').textContent = 'Active view unavailable.';
|
||||||
const mockIssues = [
|
qs('#issues-content').innerHTML = '<div class="muted">Work items unavailable.</div>';
|
||||||
{ number: 1, title: 'Kickoff issue', state: 'open', labels: ['epic'], url: '#1' },
|
qs('#prs-content').innerHTML = '<div class="muted">Work items unavailable.</div>';
|
||||||
{ number: 8, title: 'Live UI implementation', state: 'open', labels: ['frontend'], url: '#8' },
|
paintDeltas([]);
|
||||||
{ number: 37, title: 'Docker build and push', state: 'open', labels: ['devops'], url: '#37' },
|
|
||||||
];
|
|
||||||
qs('#issues-content').innerHTML = mockIssues.map(i => '<div style="margin:6px 0;"><a href="' + escAttr(i.url) + '">#' + i.number + ' ' + escapeHtml(i.title) + '</a><div class="muted">' + (i.labels||[]).map(l=>'<span class="pill">'+escapeHtml(String(l))+'</span>').join(' ') + '</div></div>').join('');
|
|
||||||
const mockPrs = [
|
|
||||||
{ number: 4, title: 'Agent UI delta binding', state: 'open', user: 'turdbot', url: '#4' },
|
|
||||||
];
|
|
||||||
qs('#prs-content').innerHTML = mockPrs.map(p => '<div style="margin:6px 0;"><a href="' + escAttr(p.url) + '">#' + p.number + ' ' + escapeHtml(p.title) + '</a><div class="muted">' + escapeHtml(p.state) + ' by ' + escapeHtml(String(p.user||'')) + '</div></div>').join('');
|
|
||||||
paintDeltas([
|
|
||||||
{panel:'triage', action:'open', target:'#1', priority:'high'},
|
|
||||||
{panel:'review', action:'review', target:'#4', priority:'medium'},
|
|
||||||
{panel:'layout', action:'highlight', target:'issues', priority:'low'},
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,17 @@ async def test_dashboard_marks_fallback_context_as_degraded_instead_of_live():
|
||||||
assert "data.error ? 'Degraded · ' + data.error : 'Live · updated just now'" in html
|
assert "data.error ? 'Degraded · ' + data.error : 'Live · updated just now'" in html
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.anyio
|
||||||
|
async def test_dashboard_does_not_offer_fabricated_work_when_context_fetch_fails():
|
||||||
|
html = await dashboard()
|
||||||
|
|
||||||
|
assert "Work items unavailable." in html
|
||||||
|
assert "Kickoff issue" not in html
|
||||||
|
assert "Live UI implementation" not in html
|
||||||
|
assert "Docker build and push" not in html
|
||||||
|
assert "Agent UI delta binding" not in html
|
||||||
|
|
||||||
|
|
||||||
def test_repo_mix_reports_unavailable_for_failed_context_response():
|
def test_repo_mix_reports_unavailable_for_failed_context_response():
|
||||||
script = f"""
|
script = f"""
|
||||||
const updateRepoMix = require({json.dumps(str(WIDGETS))});
|
const updateRepoMix = require({json.dumps(str(WIDGETS))});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user