panel: add a return control to the Quest Log header
A child who opened their Quest Log could only get back to the Party board by waiting out the 40 s idle return. The header now carries a 72px "The Party" button (left chevron, left of the crest) that calls the existing _returnToBoard() path the idle return uses. The idle return, crest-tap navigation and 1c auto-return are unchanged. Documented in PANEL-SPEC §3; jsdom test taps it and asserts navigation to the strategy-computed board_path; bundle rebuilt. Task: 987d2d0f-a5d1-4bb5-a1f3-80fd6adbf5e9 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
* tap_complete: <instance id> the harness taps that card's Complete button,
|
||||
* records whether the confirm dialog opened, taps the dialog's Complete, and
|
||||
* reports every hass.callService call as tap: {dialog_opened, service_calls}.
|
||||
* With tap_return: true the harness taps the header's return control and
|
||||
* reports it as returned: {rendered, label} before the final snapshot.
|
||||
* The Python panel tests drive this harness so the
|
||||
* assertions run against the exact bundle HACS ships.
|
||||
*/
|
||||
@@ -75,6 +77,17 @@ if (spec.tap_complete !== undefined) {
|
||||
tap = { dialog_opened: confirm !== null, service_calls: serviceCalls };
|
||||
}
|
||||
|
||||
let returned = null;
|
||||
if (spec.tap_return) {
|
||||
const control = element.shadowRoot.querySelector(".header button.return");
|
||||
returned = {
|
||||
rendered: control !== null,
|
||||
label: control?.textContent?.trim() ?? "",
|
||||
};
|
||||
control?.click();
|
||||
await element.updateComplete;
|
||||
}
|
||||
|
||||
const snapshot = () => ({
|
||||
location: window.location.pathname,
|
||||
headline: element.shadowRoot.querySelector(".title")?.textContent?.trim() ?? "",
|
||||
@@ -110,6 +123,6 @@ if (spec.idle_ms !== undefined) {
|
||||
await new Promise((resolve) => setTimeout(resolve, spec.idle_ms));
|
||||
}
|
||||
|
||||
const payload = JSON.stringify({ ...snapshot(), probe, tap });
|
||||
const payload = JSON.stringify({ ...snapshot(), probe, tap, returned });
|
||||
await new Promise((resolve) => process.stdout.write(payload, () => resolve()));
|
||||
process.exit(0);
|
||||
Reference in New Issue
Block a user