diff --git a/server/src/wled_controller/static/css/automations.css b/server/src/wled_controller/static/css/automations.css index a53290d..3b3a909 100644 --- a/server/src/wled_controller/static/css/automations.css +++ b/server/src/wled_controller/static/css/automations.css @@ -52,9 +52,26 @@ .rule-header { display: flex; - justify-content: space-between; align-items: center; - margin-bottom: 8px; + gap: 6px; +} + +.rule-collapse-chevron { + cursor: pointer; + font-size: 0.7rem; + color: var(--text-muted); + transition: transform 0.15s ease; + user-select: none; + flex-shrink: 0; + padding: 2px; +} + +.rule-collapse-chevron:hover { + color: var(--text-color); +} + +.rule-header .btn-remove-rule { + margin-left: auto; } .rule-type-label { @@ -97,6 +114,10 @@ height: 16px; } +.rule-fields-container { + margin-top: 8px; +} + .rule-fields { display: flex; flex-direction: column; diff --git a/server/src/wled_controller/static/js/features/automations.ts b/server/src/wled_controller/static/js/features/automations.ts index 18f35c6..56a8937 100644 --- a/server/src/wled_controller/static/js/features/automations.ts +++ b/server/src/wled_controller/static/js/features/automations.ts @@ -637,14 +637,24 @@ function addAutomationRuleRow(rule: any) { row.innerHTML = `
+
-
+ `; + // Wire collapse/expand toggle + const chevron = row.querySelector('.rule-collapse-chevron') as HTMLElement; + chevron.addEventListener('click', () => { + const fields = row.querySelector('.rule-fields-container') as HTMLElement; + const collapsed = fields.style.display === 'none'; + fields.style.display = collapsed ? '' : 'none'; + chevron.style.transform = collapsed ? 'rotate(90deg)' : ''; + }); + const typeSelect = row.querySelector('.rule-type-select') as HTMLSelectElement; const container = row.querySelector('.rule-fields-container') as HTMLElement; diff --git a/server/src/wled_controller/static/js/features/home-assistant-sources.ts b/server/src/wled_controller/static/js/features/home-assistant-sources.ts index 9668b47..700a80e 100644 --- a/server/src/wled_controller/static/js/features/home-assistant-sources.ts +++ b/server/src/wled_controller/static/js/features/home-assistant-sources.ts @@ -7,7 +7,7 @@ import { fetchWithAuth, escapeHtml } from '../core/api.ts'; import { t } from '../core/i18n.ts'; import { Modal } from '../core/modal.ts'; import { showToast, showConfirm } from '../core/ui.ts'; -import { ICON_CLONE, ICON_EDIT, ICON_TEST } from '../core/icons.ts'; +import { ICON_CLONE, ICON_EDIT, ICON_REFRESH } from '../core/icons.ts'; import * as P from '../core/icon-paths.ts'; import { wrapCard } from '../core/card-colors.ts'; import { TagInput, renderTagChips } from '../core/tag-input.ts'; @@ -251,7 +251,7 @@ export function createHASourceCard(source: HomeAssistantSource) { ${renderTagChips(source.tags)} ${source.description ? `
${escapeHtml(source.description)}
` : ''}`, actions: ` - + `, }); diff --git a/server/src/wled_controller/templates/modals/ha-source-editor.html b/server/src/wled_controller/templates/modals/ha-source-editor.html index 59af7b3..c1dbad0 100644 --- a/server/src/wled_controller/templates/modals/ha-source-editor.html +++ b/server/src/wled_controller/templates/modals/ha-source-editor.html @@ -74,7 +74,7 @@