Split adaptive value source into explicit adaptive_time and adaptive_scene types

Replace single "adaptive" type with adaptive_mode sub-selector by two
distinct source types in the dropdown. Removes the adaptive_mode field
entirely — the source_type itself carries the mode. Clearer UX with
"Adaptive (Time of Day)" and "Adaptive (Scene)" as separate options.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 15:23:50 +03:00
parent d339dd3f90
commit 1e4a7a067f
10 changed files with 142 additions and 170 deletions

View File

@@ -32,7 +32,8 @@
<option value="static" data-i18n="value_source.type.static">Static</option>
<option value="animated" data-i18n="value_source.type.animated">Animated</option>
<option value="audio" data-i18n="value_source.type.audio">Audio</option>
<option value="adaptive" data-i18n="value_source.type.adaptive">Adaptive</option>
<option value="adaptive_time" data-i18n="value_source.type.adaptive_time">Adaptive (Time of Day)</option>
<option value="adaptive_scene" data-i18n="value_source.type.adaptive_scene">Adaptive (Scene)</option>
</select>
</div>
@@ -161,87 +162,73 @@
</div>
</div>
<!-- Adaptive fields -->
<div id="value-source-adaptive-section" style="display:none">
<!-- Sub-mode selector -->
<!-- Adaptive Time of Day fields -->
<div id="value-source-adaptive-time-section" style="display:none">
<div class="form-group">
<div class="label-row">
<label for="value-source-adaptive-mode" data-i18n="value_source.adaptive_mode">Adaptive Mode:</label>
<label data-i18n="value_source.schedule">Schedule:</label>
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?" data-i18n-aria-label="aria.hint">?</button>
</div>
<small class="input-hint" style="display:none" data-i18n="value_source.adaptive_mode.hint">Time of Day adjusts brightness on a daily schedule. Scene analyzes picture brightness in real time.</small>
<select id="value-source-adaptive-mode" onchange="onAdaptiveModeChange()">
<option value="time_of_day" data-i18n="value_source.adaptive_mode.time_of_day">Time of Day</option>
<option value="scene" data-i18n="value_source.adaptive_mode.scene">Scene Brightness</option>
<small class="input-hint" style="display:none" data-i18n="value_source.schedule.hint">Define at least 2 time points. Brightness interpolates linearly between them, wrapping at midnight.</small>
<div id="value-source-schedule-list" class="schedule-list"></div>
<button type="button" class="btn btn-secondary btn-sm" onclick="addSchedulePoint()" data-i18n="value_source.schedule.add">+ Add Point</button>
</div>
</div>
<!-- Adaptive Scene fields -->
<div id="value-source-adaptive-scene-section" style="display:none">
<div class="form-group">
<div class="label-row">
<label for="value-source-picture-source" data-i18n="value_source.picture_source">Picture Source:</label>
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?" data-i18n-aria-label="aria.hint">?</button>
</div>
<small class="input-hint" style="display:none" data-i18n="value_source.picture_source.hint">The picture source whose frames will be analyzed for average brightness.</small>
<select id="value-source-picture-source">
<!-- populated dynamically -->
</select>
</div>
<!-- Time of Day sub-section -->
<div id="value-source-tod-section">
<div class="form-group">
<div class="label-row">
<label data-i18n="value_source.schedule">Schedule:</label>
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?" data-i18n-aria-label="aria.hint">?</button>
</div>
<small class="input-hint" style="display:none" data-i18n="value_source.schedule.hint">Define at least 2 time points. Brightness interpolates linearly between them, wrapping at midnight.</small>
<div id="value-source-schedule-list" class="schedule-list"></div>
<button type="button" class="btn btn-secondary btn-sm" onclick="addSchedulePoint()" data-i18n="value_source.schedule.add">+ Add Point</button>
<div class="form-group">
<div class="label-row">
<label for="value-source-scene-behavior" data-i18n="value_source.scene_behavior">Behavior:</label>
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?" data-i18n-aria-label="aria.hint">?</button>
</div>
<small class="input-hint" style="display:none" data-i18n="value_source.scene_behavior.hint">Complement: dark scene = high brightness (ideal for ambient backlight). Match: bright scene = high brightness.</small>
<select id="value-source-scene-behavior">
<option value="complement" data-i18n="value_source.scene_behavior.complement">Complement (dark → bright)</option>
<option value="match" data-i18n="value_source.scene_behavior.match">Match (bright → bright)</option>
</select>
</div>
<div class="form-group">
<div class="label-row">
<label for="value-source-scene-sensitivity" data-i18n="value_source.sensitivity">Sensitivity:</label>
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?" data-i18n-aria-label="aria.hint">?</button>
</div>
<small class="input-hint" style="display:none" data-i18n="value_source.scene_sensitivity.hint">Gain multiplier for the luminance signal (higher = more reactive to brightness changes)</small>
<div class="range-with-value">
<input type="range" id="value-source-scene-sensitivity" min="0.1" max="5" step="0.1" value="1.0"
oninput="document.getElementById('value-source-scene-sensitivity-display').textContent = this.value">
<span id="value-source-scene-sensitivity-display">1.0</span>
</div>
</div>
<!-- Scene sub-section -->
<div id="value-source-scene-section" style="display:none">
<div class="form-group">
<div class="label-row">
<label for="value-source-picture-source" data-i18n="value_source.picture_source">Picture Source:</label>
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?" data-i18n-aria-label="aria.hint">?</button>
</div>
<small class="input-hint" style="display:none" data-i18n="value_source.picture_source.hint">The picture source whose frames will be analyzed for average brightness.</small>
<select id="value-source-picture-source">
<!-- populated dynamically -->
</select>
<div class="form-group">
<div class="label-row">
<label for="value-source-scene-smoothing" data-i18n="value_source.smoothing">Smoothing:</label>
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?" data-i18n-aria-label="aria.hint">?</button>
</div>
<div class="form-group">
<div class="label-row">
<label for="value-source-scene-behavior" data-i18n="value_source.scene_behavior">Behavior:</label>
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?" data-i18n-aria-label="aria.hint">?</button>
</div>
<small class="input-hint" style="display:none" data-i18n="value_source.scene_behavior.hint">Complement: dark scene = high brightness (ideal for ambient backlight). Match: bright scene = high brightness.</small>
<select id="value-source-scene-behavior">
<option value="complement" data-i18n="value_source.scene_behavior.complement">Complement (dark → bright)</option>
<option value="match" data-i18n="value_source.scene_behavior.match">Match (bright → bright)</option>
</select>
</div>
<div class="form-group">
<div class="label-row">
<label for="value-source-scene-sensitivity" data-i18n="value_source.sensitivity">Sensitivity:</label>
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?" data-i18n-aria-label="aria.hint">?</button>
</div>
<small class="input-hint" style="display:none" data-i18n="value_source.scene_behavior.hint">Gain multiplier for the luminance signal (higher = more reactive to brightness changes)</small>
<div class="range-with-value">
<input type="range" id="value-source-scene-sensitivity" min="0.1" max="5" step="0.1" value="1.0"
oninput="document.getElementById('value-source-scene-sensitivity-display').textContent = this.value">
<span id="value-source-scene-sensitivity-display">1.0</span>
</div>
</div>
<div class="form-group">
<div class="label-row">
<label for="value-source-scene-smoothing" data-i18n="value_source.smoothing">Smoothing:</label>
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?" data-i18n-aria-label="aria.hint">?</button>
</div>
<small class="input-hint" style="display:none" data-i18n="value_source.smoothing.hint">Temporal smoothing (0 = instant response, 1 = very smooth transitions)</small>
<div class="range-with-value">
<input type="range" id="value-source-scene-smoothing" min="0" max="1" step="0.05" value="0.3"
oninput="document.getElementById('value-source-scene-smoothing-display').textContent = this.value">
<span id="value-source-scene-smoothing-display">0.3</span>
</div>
<small class="input-hint" style="display:none" data-i18n="value_source.smoothing.hint">Temporal smoothing (0 = instant response, 1 = very smooth transitions)</small>
<div class="range-with-value">
<input type="range" id="value-source-scene-smoothing" min="0" max="1" step="0.05" value="0.3"
oninput="document.getElementById('value-source-scene-smoothing-display').textContent = this.value">
<span id="value-source-scene-smoothing-display">0.3</span>
</div>
</div>
</div>
<!-- Shared: output range -->
<!-- Shared adaptive output range (shown for both adaptive types) -->
<div id="value-source-adaptive-range-section" style="display:none">
<div class="form-group">
<div class="label-row">
<label for="value-source-adaptive-min-value" data-i18n="value_source.adaptive_min_value">Min Value:</label>