From 04f52c4ac7ef5faf524c4413afcbc92eeddce144 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Wed, 22 Apr 2026 11:19:52 -0500 Subject: [PATCH] Fix weather settings layout groups --- .../components/tools/device_settings.js | 21 ++++++-- .../tools/device_settings_layout.json | 54 +++++++++---------- 2 files changed, 42 insertions(+), 33 deletions(-) diff --git a/starpilot/system/the_pond/assets/components/tools/device_settings.js b/starpilot/system/the_pond/assets/components/tools/device_settings.js index 149712d21..abb238274 100644 --- a/starpilot/system/the_pond/assets/components/tools/device_settings.js +++ b/starpilot/system/the_pond/assets/components/tools/device_settings.js @@ -43,6 +43,18 @@ function getSectionsWithSlug() { })) } +function isGroupParam(param) { + return param?.ui_type === "group" +} + +function isParamEnabledForChildren(paramOrKey) { + const param = typeof paramOrKey === "string" ? state.paramMetaByKey[paramOrKey] : paramOrKey + if (isGroupParam(param)) return true + + const key = typeof paramOrKey === "string" ? paramOrKey : param?.key + return !!state.values[key] +} + function toSelectValue(value) { return value === null || value === undefined ? "" : String(value) } @@ -715,12 +727,13 @@ function handleSectionTabClick(sectionSlug, event) { function renderSettingRow(p) { if (p.parent_key && !state.filter) { - if (!state.values[p.parent_key]) return "" + if (!isParamEnabledForChildren(p.parent_key)) return "" if (!state.expanded[p.parent_key]) return "" } const isNumeric = p.ui_type === "numeric" const isColor = p.ui_type === "color" + const isGroup = isGroupParam(p) const isChild = p.parent_key ? "ds-child-modifier" : "" const lockReason = getSettingLockReason(p) const isLocked = lockReason !== "" @@ -733,7 +746,7 @@ function renderSettingRow(p) { ${p.description ? html`