Kids' panel: render the definition icon on the open quest card (#245)
This commit was merged in pull request #245.
This commit is contained in:
@@ -2057,7 +2057,7 @@ export class NestQuestQuestLogCard extends LitElement {
|
||||
: "";
|
||||
return html`
|
||||
<div class="quest sealed" data-instance-id=${instance.id}>
|
||||
<span class="tile" aria-hidden="true">${renderQuestIcon(instance.icon, ICON_STAR)}</span>
|
||||
<span class="tile" aria-hidden="true">${ICON_STAR}</span>
|
||||
<div class="body">
|
||||
<span class="quest-title">${instance.title}</span>
|
||||
<span class="meta">
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
* the card is mounted at the given URL (it resolves its child from the
|
||||
* pathname's last segment), after the optional probe wait one snapshot of
|
||||
* the render is taken mid-wait, then after the optional idle wait stdout
|
||||
* receives one JSON object {location, headline, countdown, html, probe} —
|
||||
* the final window pathname, the rendered title, the complete-screen
|
||||
* countdown text, the rendered shadow DOM, and the probe snapshot when
|
||||
* probe_ms was given. The Python panel tests drive this harness so the
|
||||
* receives one JSON object {location, headline, countdown, html, tiles,
|
||||
* probe} — the final window pathname, the rendered title, the
|
||||
* complete-screen countdown text, the rendered shadow DOM, each quest
|
||||
* card's icon tile, and the probe snapshot when probe_ms was given. The Python panel tests drive this harness so the
|
||||
* assertions run against the exact bundle HACS ships.
|
||||
*/
|
||||
import { readFileSync } from "node:fs";
|
||||
@@ -56,6 +56,22 @@ const snapshot = () => ({
|
||||
element.shadowRoot.querySelector(".complete-countdown")?.textContent?.trim() ??
|
||||
"",
|
||||
html: element.shadowRoot.innerHTML,
|
||||
// Each quest card's icon tile: the registry glyph it rendered (its
|
||||
// data-icon key and svg fill), its text (an emoji), and whether it shows
|
||||
// the static star (the star's polygon).
|
||||
tiles: [...element.shadowRoot.querySelectorAll(".quest")].map((quest) => {
|
||||
const tile = quest.querySelector(".tile");
|
||||
const glyph = tile?.querySelector("[data-icon]");
|
||||
return {
|
||||
id: Number(quest.dataset.instanceId),
|
||||
sealed: quest.classList.contains("sealed"),
|
||||
icon: glyph?.getAttribute("data-icon") ?? null,
|
||||
fill: glyph?.getAttribute("fill") ?? null,
|
||||
paths: tile?.querySelectorAll("path").length ?? 0,
|
||||
text: tile?.textContent?.trim() ?? "",
|
||||
star: Boolean(tile?.querySelector("polygon")),
|
||||
};
|
||||
}),
|
||||
});
|
||||
|
||||
let probe = null;
|
||||
|
||||
Reference in New Issue
Block a user