diff --git a/client/public/version.js b/client/public/version.js index a49f152..8795fc1 100644 --- a/client/public/version.js +++ b/client/public/version.js @@ -1,5 +1,5 @@ // Maintainer-controlled web client version. // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) -window.CHGRID_WEB_VERSION = "2026.02.25 R272"; +window.CHGRID_WEB_VERSION = "2026.02.25 R273"; // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. window.CHGRID_TIME_ZONE = "America/Detroit"; diff --git a/client/src/items/itemPropertyEditor.ts b/client/src/items/itemPropertyEditor.ts index 60572a4..f41df5e 100644 --- a/client/src/items/itemPropertyEditor.ts +++ b/client/src/items/itemPropertyEditor.ts @@ -117,10 +117,7 @@ export function createItemPropertyEditor(deps: EditorDeps): { } const metadata = deps.getItemPropertyMetadata(item.type, selectedKey); if (metadata?.valueType === 'boolean') { - let current = item.params[selectedKey]; - if (typeof current !== 'boolean') { - current = item.params[selectedKey] === true; - } + const current = deps.getItemPropertyValue(item, selectedKey).toLowerCase() === 'on'; const nextValue = !current; deps.suppressItemPropertyEchoMs(600); deps.signalingSend({ type: 'item_update', itemId, params: { [selectedKey]: nextValue } }); @@ -169,8 +166,8 @@ export function createItemPropertyEditor(deps: EditorDeps): { } const metadata = deps.getItemPropertyMetadata(item.type, selectedKey); if (metadata?.valueType === 'boolean') { - const current = item.params[selectedKey]; - const nextValue = typeof current === 'boolean' ? !current : deps.getItemPropertyValue(item, selectedKey).toLowerCase() !== 'on'; + const current = deps.getItemPropertyValue(item, selectedKey).toLowerCase() === 'on'; + const nextValue = !current; deps.signalingSend({ type: 'item_update', itemId, params: { [selectedKey]: nextValue } }); deps.onPreviewPropertyChange?.(item, selectedKey, nextValue); deps.updateStatus(`${deps.itemPropertyLabel(selectedKey)}: ${nextValue ? 'on' : 'off'}`); @@ -188,7 +185,7 @@ export function createItemPropertyEditor(deps: EditorDeps): { selectedKey === 'title' ? item.title : selectedMetadata?.valueType === 'boolean' - ? item.params[selectedKey] === true + ? deps.getItemPropertyValue(item, selectedKey).toLowerCase() === 'on' ? 'on' : 'off' : String(item.params[selectedKey] ?? ''); diff --git a/client/src/items/itemPropertyPresentation.ts b/client/src/items/itemPropertyPresentation.ts index 438235e..563f239 100644 --- a/client/src/items/itemPropertyPresentation.ts +++ b/client/src/items/itemPropertyPresentation.ts @@ -48,16 +48,7 @@ export function createItemPropertyPresentation(deps: PresentationDeps): { if (key === 'capabilities') return item.capabilities.join(', ') || 'none'; if (key === 'useSound') return toSoundDisplayName(item.params.useSound ?? item.useSound); if (key === 'emitSound') return toSoundDisplayName(item.params.emitSound ?? item.emitSound); - if (key === 'enabled') return item.params.enabled === false ? 'off' : 'on'; - if (key === 'directional') { - if (typeof item.params.directional === 'boolean') { - return item.params.directional ? 'on' : 'off'; - } - return getItemTypeGlobalProperties(item.type).directional === true ? 'on' : 'off'; - } if (key === 'timeZone') return String(item.params.timeZone ?? getDefaultClockTimeZone()); - if (key === 'use24Hour') return item.params.use24Hour === true ? 'on' : 'off'; - if (key === 'topOfHourAnnounce') return item.params.topOfHourAnnounce === true ? 'on' : 'off'; if (key === 'mediaChannel') return normalizeRadioChannel(item.params.mediaChannel); if (key === 'mediaEffect') return normalizeRadioEffect(item.params.mediaEffect); if (key === 'mediaEffectValue') return String(normalizeRadioEffectValue(item.params.mediaEffectValue)); @@ -73,9 +64,18 @@ export function createItemPropertyPresentation(deps: PresentationDeps): { if (!Number.isFinite(parsed)) return '15'; return String(Math.round(parsed)); } - const paramValue = item.params[key]; - if (paramValue !== undefined) return String(paramValue); + const metadata = getItemPropertyMetadata(item.type, key); const globalValue = getItemTypeGlobalProperties(item.type)?.[key]; + const paramValue = item.params[key]; + const rawValue = paramValue !== undefined ? paramValue : globalValue; + if (metadata?.valueType === 'boolean') { + if (rawValue === undefined && key === 'enabled') return 'on'; + return rawValue === true ? 'on' : 'off'; + } + if (metadata?.valueType === 'sound') { + return toSoundDisplayName(rawValue); + } + if (paramValue !== undefined) return String(paramValue); if (globalValue !== undefined) return String(globalValue); return ''; };