Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 55 additions & 3 deletions dashboard.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pulse/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ def render_html(views, now: str | None = None, campaign_data: dict | None = None
+ _html_detail(snapshot, now)
+ "</details>"
)
return (
return shared.section_layout(
'<!doctype html>\n<html lang="en"><head><meta charset="utf-8">'
'<meta name="viewport" content="width=device-width,initial-scale=1">'
"<title>PyAutoPulse dashboard</title>"
Expand Down
8 changes: 7 additions & 1 deletion pulse/setup_browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,13 @@
const incoming = Object.fromEntries(
new URLSearchParams(location.hash.slice(1)),
);
route(incoming.instance === capture.instance ? incoming : {}, false);
const linked = incoming.instance === capture.instance;
// A setup deep link is not an element ID, so reveal the collapsed
// board sections around this browser itself (PyAutoBrain#490).
if (linked)
for (let p = root.parentElement; p; p = p.parentElement)
if (p.tagName === "DETAILS") p.open = true;
route(linked ? incoming : {}, false);
}
function navigation() {
nav.replaceChildren();
Expand Down
24 changes: 24 additions & 0 deletions tests/browser_setup.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,28 @@ const { execFileSync } = require("node:child_process");
await panel
.locator("[data-orchestration-preview]")
.evaluate((el) => (el.open = false));
// Major sections start collapsed (PyAutoBrain#490); nav cards reveal them.
assert.deepEqual(
await page
.locator("details.board-section")
.evaluateAll((nodes) => nodes.map((node) => node.open)),
[false, false],
);
assert.equal(await page.locator("[data-open]").first().isVisible(), false);
await page.locator('.board-nav-card[href="#campaigns"]').click();
await page.waitForFunction(
() =>
document.getElementById("campaigns").closest("details.board-section")
.open,
);
await page.locator("[data-open]").first().click();
assert.equal(await page.locator(".campaign-detail[open]").count(), 1);
await page.locator('.board-nav-card[href="#evidence"]').click();
await page.waitForFunction(
() =>
document.getElementById("evidence").closest("details.board-section")
.open,
);
await choose();
await root.locator(".metric-value").first().waitFor();
assert.equal(
Expand Down Expand Up @@ -469,6 +489,10 @@ const { execFileSync } = require("node:child_process");
const nojs = await browser.newContext({ javaScriptEnabled: false });
const fallback = await nojs.newPage();
await fallback.goto(base);
// Native disclosures still open without JavaScript.
await fallback
.locator("details.board-section:has(#evidence) > summary")
.click();
await fallback
.getByText("Original setup evidence (JavaScript disabled)", {
exact: true,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_campaigns.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def test_control_room_precedes_measurements_and_escapes():
):
# Check content order independently of the section navigation labels.
if "<main>" in text:
text = text.split("<main>", 1)[1]
assert text.index("Profiling Check In") < text.index('class="board-nav"')
text = "Profiling Check In" + text.split("<main>", 1)[1]
assert (
text.index("Profiling Check In")
< text.index("Active campaigns")
Expand Down
Loading