Fix strategy review findings: panel views, display-name titles, weather pass-through test

- P1: every generated view now emits type: "panel" — HA defaults an
  unspecified view to Masonry, which constrains the 1080px-tall card to
  a narrow column (the exact failure the README warns about), and a
  generated dashboard leaves no editor step to set Panel by hand. Added
  a regression assertion that each view's type is "panel".
- P3: quest-log view titles use the roster's display name ("Ada's Quest
  Log") instead of the raw slug; the slug stays the view path.
- P3: added a focused test that weather_entity from the strategy config
  is passed through to every generated card config.
- P3: dropped the vestigial new (): unknown constructor from
  StrategyClass — HA calls generate() statically.
- P2: README's TouchHub setup now documents the zero-config dashboard
  strategy as the primary path, with the manual steps kept as the
  alternative (full runbook rewrite is task fc69c940).
- Rebuilt the bundle.
This commit is contained in:
2026-09-23 09:59:57 -04:00
parent 46f45aa4e5
commit d73efc8876
4 changed files with 112 additions and 18 deletions
@@ -3506,10 +3506,16 @@ function _n(s) {
return t || (window.location.pathname.split("/").filter(Boolean)[0] ?? "");
}
function yn(s) {
const n = s?.states?.["sensor.nestquest_household_quests_due_today"]?.attributes?.child_roster;
return Array.isArray(n) ? n.map((i) => gn(i)).filter((i) => i.length > 0) : [];
if (s === null || typeof s != "object" || Array.isArray(s))
return "";
const t = s.name;
return typeof t == "string" ? t.trim() : "";
}
class bn {
function bn(s) {
const n = s?.states?.["sensor.nestquest_household_quests_due_today"]?.attributes?.child_roster;
return Array.isArray(n) ? n.map((i) => ({ slug: gn(i), name: yn(i) })).filter((i) => i.slug.length > 0) : [];
}
class vn {
static async generate(t, e) {
const n = `/${_n(t)}`, i = Bt(t.weather_entity), r = {
type: "custom:nestquest-party-board-card",
@@ -3525,11 +3531,13 @@ class bn {
{
path: "party",
title: "The Party",
type: "panel",
cards: [r]
},
...yn(e).map((l) => ({
path: l,
title: `${l}'s Quest Log`,
...bn(e).map((l) => ({
path: l.slug,
title: l.name ? `${l.name}'s Quest Log` : `${l.slug}'s Quest Log`,
type: "panel",
cards: [{ ...o }]
}))
]
@@ -3537,9 +3545,9 @@ class bn {
}
}
window.customStrategies = window.customStrategies ?? {};
window.customStrategies["nestquest-party"] = bn;
const vn = "/nestquest-static/nestquest-fonts.css";
window.customStrategies["nestquest-party"] = vn;
const xn = "/nestquest-static/nestquest-fonts.css";
if (!document.querySelector('link[data-nq-fonts=""]')) {
const s = document.createElement("link");
s.rel = "stylesheet", s.href = vn, s.dataset.nqFonts = "", document.head.appendChild(s);
s.rel = "stylesheet", s.href = xn, s.dataset.nqFonts = "", document.head.appendChild(s);
}