Add EntitySelect/IconSelect UI improvements across modals

- Portal IconSelect popups to document.body with position:fixed to prevent
  clipping by modal overflow-y:auto
- Replace custom scene selectors in automation editor with EntitySelect
  command-palette pickers (main scene + fallback scene)
- Add IconSelect grid for automation deactivation mode (none/revert/fallback)
- Add IconSelect grid for automation condition type and match type
- Replace mapped zone source dropdowns with EntitySelect pickers
- Replace scene target selector with EntityPalette.pick() pattern
- Remove effect palette preview bar from CSS editor
- Remove sensitivity badge from audio color strip source cards
- Clean up unused scene-selector CSS and scene-target-add-row CSS
- Add locale keys for all new UI elements across en/ru/zh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 16:00:30 +03:00
parent 186940124c
commit 2712c6682e
32 changed files with 1204 additions and 391 deletions

View File

@@ -133,14 +133,42 @@ async def update_scene_preset(
data: ScenePresetUpdate,
_auth: AuthRequired,
store: ScenePresetStore = Depends(get_scene_preset_store),
target_store: OutputTargetStore = Depends(get_output_target_store),
manager: ProcessorManager = Depends(get_processor_manager),
):
"""Update scene preset metadata."""
"""Update scene preset metadata and optionally change targets."""
# If target_ids changed, update the snapshot: keep state for existing targets,
# capture fresh state for newly added targets, drop removed ones.
new_targets = None
if data.target_ids is not None:
try:
existing = store.get_preset(preset_id)
except ValueError as e:
raise HTTPException(status_code=404, detail=str(e))
existing_map = {t.target_id: t for t in existing.targets}
new_target_ids = set(data.target_ids)
# Capture fresh state for newly added targets
added_ids = new_target_ids - set(existing_map.keys())
fresh = capture_current_snapshot(target_store, manager, added_ids) if added_ids else []
fresh_map = {t.target_id: t for t in fresh}
# Build new target list preserving order from target_ids
new_targets = []
for tid in data.target_ids:
if tid in existing_map:
new_targets.append(existing_map[tid])
elif tid in fresh_map:
new_targets.append(fresh_map[tid])
try:
preset = store.update_preset(
preset_id,
name=data.name,
description=data.description,
order=data.order,
targets=new_targets,
)
except ValueError as e:
raise HTTPException(status_code=404 if "not found" in str(e).lower() else 400, detail=str(e))