From a4a0e39b9b08092399b31dd5d3f39bc3c9748f44 Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Mon, 16 Mar 2026 17:46:37 +0300 Subject: [PATCH] =?UTF-8?q?Replace=20bare=20=E2=80=94=20and=20generic=20No?= =?UTF-8?q?ne=20in=20selectors=20with=20descriptive=20None=20(reason)=20la?= =?UTF-8?q?bels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All optional entity selectors now use the format "None (description)" with i18n keys instead of hardcoded "—" or bare "None". Added common.none_no_cspt, common.none_no_input, common.none_own_speed keys to all 3 locales. Updated frontend context with the convention. Co-Authored-By: Claude Opus 4.6 (1M context) --- contexts/frontend.md | 13 +++++++++++++ .../static/js/features/color-strips.js | 12 ++++++------ .../static/js/features/device-discovery.js | 4 ++-- .../wled_controller/static/js/features/devices.js | 4 ++-- server/src/wled_controller/static/locales/en.json | 7 +++++-- server/src/wled_controller/static/locales/ru.json | 7 +++++-- server/src/wled_controller/static/locales/zh.json | 7 +++++-- 7 files changed, 38 insertions(+), 16 deletions(-) diff --git a/contexts/frontend.md b/contexts/frontend.md index 6b7f7a9..11dad8f 100644 --- a/contexts/frontend.md +++ b/contexts/frontend.md @@ -55,6 +55,19 @@ Add hint text to both `en.json` and `ru.json` locale files using a `.hint` suffi Do **not** add placeholder options like `-- Select something --`. Populate the `` dropdowns should be enhanced with visual selectors depending on the data type: diff --git a/server/src/wled_controller/static/js/features/color-strips.js b/server/src/wled_controller/static/js/features/color-strips.js index a1933eb..62c5c03 100644 --- a/server/src/wled_controller/static/js/features/color-strips.js +++ b/server/src/wled_controller/static/js/features/color-strips.js @@ -222,7 +222,7 @@ export function onCSSTypeChange() { function _populateClockDropdown(selectedId) { const sel = document.getElementById('css-editor-clock'); const prev = selectedId !== undefined ? selectedId : sel.value; - sel.innerHTML = `` + + sel.innerHTML = `` + _cachedSyncClocks.map(c => ``).join(''); sel.value = prev || ''; @@ -238,7 +238,7 @@ function _populateClockDropdown(selectedId) { })), placeholder: t('palette.search'), allowNone: true, - noneLabel: t('common.none'), + noneLabel: t('common.none_own_speed'), }); } @@ -253,7 +253,7 @@ function _populateProcessedSelectors() { const inputSources = allSources.filter(s => s.id !== editingId && s.source_type !== 'processed'); const inputSel = document.getElementById('css-editor-processed-input'); const prevInput = inputSel.value; - inputSel.innerHTML = '' + + inputSel.innerHTML = `` + inputSources.map(s => ``).join(''); inputSel.value = prevInput || ''; if (_processedInputEntitySelect) _processedInputEntitySelect.destroy(); @@ -270,7 +270,7 @@ function _populateProcessedSelectors() { const templates = csptCache.data || []; const tplSel = document.getElementById('css-editor-processed-template'); const prevTpl = tplSel.value; - tplSel.innerHTML = '' + + tplSel.innerHTML = `` + templates.map(tp => ``).join(''); tplSel.value = prevTpl || ''; if (_processedTemplateEntitySelect) _processedTemplateEntitySelect.destroy(); @@ -644,7 +644,7 @@ function _compositeRenderList() { `` ).join(''); const csptList = _cachedCSPTemplates || []; - const csptOptions = `` + + const csptOptions = `` + csptList.map(tmpl => `` ).join(''); @@ -734,7 +734,7 @@ function _compositeRenderList() { getItems: _getCompositeCSPTItems, placeholder: t('palette.search'), allowNone: true, - noneLabel: t('common.none'), + noneLabel: t('common.none_no_cspt'), })); }); } diff --git a/server/src/wled_controller/static/js/features/device-discovery.js b/server/src/wled_controller/static/js/features/device-discovery.js index 7e9d6be..4fdbee8 100644 --- a/server/src/wled_controller/static/js/features/device-discovery.js +++ b/server/src/wled_controller/static/js/features/device-discovery.js @@ -70,7 +70,7 @@ function _ensureCsptEntitySelect() { if (!sel) return; const templates = csptCache.data || []; // Populate native