Add a collapsed "Seen" section to the control board page (#1503)
Jason asked for a way to recall rows he marked Seen. The page now lists them under a collapsed "Seen (N)" section between "Waiting on you" and "By project", each with Unsee. Open/closed state survives the 10-second refresh because only the section body is re-rendered. Page-only change plus one static test. Tests: control-board 64/64, registry 69/69. Review APPROVED, no findings. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
@@ -535,3 +535,14 @@ test("page.html: seenControl() escapes rec.project/agent/lastActivity, and the P
|
||||
assert.match(body, /esc\(rec\.lastActivity\)/);
|
||||
assert.match(html, /headers:\s*\{\s*"content-type":\s*"application\/json"\s*\}/, "the seen POST must send content-type: application/json");
|
||||
});
|
||||
|
||||
test("page.html: has a collapsed Seen section that lists seen rows with the shared row builder", () => {
|
||||
const html = readFileSync(join(pkgRoot, "src", "page.html"), "utf8");
|
||||
assert.match(html, /<details id="seenDetails">(?![^>]*\sopen)/, "the Seen section must start collapsed");
|
||||
assert.match(html, /<h2 id="seen-h">Seen<\/h2>/);
|
||||
const m = html.match(/function renderSeen\(data\) \{[\s\S]*?\n \}/);
|
||||
assert.ok(m, "renderSeen() must exist in page.html");
|
||||
assert.match(m[0], /filter\(function \(r\) \{ return r\.seen; \}\)/, "the Seen section lists exactly the rows the API marks seen");
|
||||
assert.match(m[0], /buildRowPair\(r, true\)/, "seen rows reuse the escaped row builder, project column included");
|
||||
assert.match(html, /renderWaiting\(lastData\);\n\s*renderSeen\(lastData\);/, "renderAll must render the Seen section on every refresh");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user