--- title: UI Feedback --- ```js import {API, POLL} from "./components/config.js"; ``` ```js const feedbackState = (async function*() { while (true) { let data = [], ok = false; try { const r = await fetch(`${API}/technical-debt/?debt_type=dashboard-improvement`); ok = r.ok; if (ok) { const items = await r.json(); data = items .filter(t => t.debt_type === "dashboard-improvement") .sort((a, b) => { const st = {open: 0, in_progress: 1, deferred: 2, resolved: 3, wont_fix: 4}; return (st[a.status] ?? 9) - (st[b.status] ?? 9); }); } } catch {} yield {data, ok, ts: new Date()}; await new Promise(res => setTimeout(res, POLL)); } })(); ``` ```js const data = feedbackState.data ?? []; const _ok = feedbackState.ok ?? false; const _ts = feedbackState.ts; ``` # UI Feedback ```js import {injectTocTop} from "./components/toc-sidebar.js"; import {withDocHelp} from "./components/doc-overlay.js"; const _open = data.filter(t => t.status === "open" || t.status === "in_progress"); const _resolved = data.filter(t => t.status === "resolved"); const _wontFix = data.filter(t => t.status === "wont_fix"); const _kpiBox = html`
make api`}
No open suggestions. Right-click any dashboard widget to submit one.
`); } else { display(html`Nothing resolved yet.
`); } else { display(html`