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`
${p.description}
` : ""} ${lockReason ? html`
Locked: ${lockReason}
` : ""} - ${() => p.is_parent_toggle && state.values[p.key] ? html` + ${() => p.is_parent_toggle && isParamEnabledForChildren(p) ? html`
${state.expanded[p.key] ? "Close" : "Manage"} @@ -829,7 +842,7 @@ function renderSettingRow(p) { ?disabled="${() => isLocked || isStockColorValue(state.values[p.key])}" @click="${() => resetColorParam(p)}">Stock
- ` : html` + ` : isGroup ? "" : html`