Replace bare — and generic None in selectors with descriptive None (reason) labels

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) <noreply@anthropic.com>
This commit is contained in:
2026-03-16 17:46:37 +03:00
parent bbe42ee0a2
commit a4a0e39b9b
7 changed files with 38 additions and 16 deletions

View File

@@ -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 = `<option value="">${t('common.none')}</option>` +
sel.innerHTML = `<option value="">${t('common.none_own_speed')}</option>` +
_cachedSyncClocks.map(c => `<option value="${c.id}">${escapeHtml(c.name)} (${c.speed}x)</option>`).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 = '<option value=""></option>' +
inputSel.innerHTML = `<option value="">${t('common.none_no_input')}</option>` +
inputSources.map(s => `<option value="${s.id}">${escapeHtml(s.name)}</option>`).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 = '<option value=""></option>' +
tplSel.innerHTML = `<option value="">${t('common.none_no_cspt')}</option>` +
templates.map(tp => `<option value="${tp.id}">${escapeHtml(tp.name)}</option>`).join('');
tplSel.value = prevTpl || '';
if (_processedTemplateEntitySelect) _processedTemplateEntitySelect.destroy();
@@ -644,7 +644,7 @@ function _compositeRenderList() {
`<option value="${v.id}"${layer.brightness_source_id === v.id ? ' selected' : ''}>${escapeHtml(v.name)}</option>`
).join('');
const csptList = _cachedCSPTemplates || [];
const csptOptions = `<option value="">${t('common.none')}</option>` +
const csptOptions = `<option value="">${t('common.none_no_cspt')}</option>` +
csptList.map(tmpl =>
`<option value="${tmpl.id}"${layer.processing_template_id === tmpl.id ? ' selected' : ''}>${escapeHtml(tmpl.name)}</option>`
).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'),
}));
});
}

View File

@@ -70,7 +70,7 @@ function _ensureCsptEntitySelect() {
if (!sel) return;
const templates = csptCache.data || [];
// Populate native <select> options
sel.innerHTML = `<option value=""></option>` +
sel.innerHTML = `<option value="">${t('common.none_no_cspt')}</option>` +
templates.map(tp => `<option value="${tp.id}">${tp.name}</option>`).join('');
if (_csptEntitySelect) _csptEntitySelect.destroy();
if (templates.length > 0) {
@@ -84,7 +84,7 @@ function _ensureCsptEntitySelect() {
})),
placeholder: t('palette.search'),
allowNone: true,
noneLabel: '—',
noneLabel: t('common.none_no_cspt'),
});
}
}

View File

@@ -24,7 +24,7 @@ function _ensureSettingsCsptSelect() {
const sel = document.getElementById('settings-css-processing-template');
if (!sel) return;
const templates = csptCache.data || [];
sel.innerHTML = `<option value=""></option>` +
sel.innerHTML = `<option value="">${t('common.none_no_cspt')}</option>` +
templates.map(tp => `<option value="${tp.id}">${tp.name}</option>`).join('');
if (_settingsCsptEntitySelect) _settingsCsptEntitySelect.destroy();
if (templates.length > 0) {
@@ -38,7 +38,7 @@ function _ensureSettingsCsptSelect() {
})),
placeholder: window.t ? t('palette.search') : 'Search...',
allowNone: true,
noneLabel: '—',
noneLabel: t('common.none_no_cspt'),
});
}
}