Add tags to all entity types with chip-based input and autocomplete

- Add `tags: List[str]` field to all 13 entity types (devices, output targets,
  CSS sources, picture sources, audio sources, value sources, sync clocks,
  automations, scene presets, capture/audio/PP/pattern templates)
- Update all stores, schemas, and route handlers for tag CRUD
- Add GET /api/v1/tags endpoint aggregating unique tags across all stores
- Create TagInput component with chip display, autocomplete dropdown,
  keyboard navigation, and API-backed suggestions
- Display tag chips on all entity cards (searchable via existing text filter)
- Add tag input to all 14 editor modals with dirty check support
- Add CSS styles and i18n keys (en/ru/zh) for tag UI
- Also includes code review fixes: thread safety, perf, store dedup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 22:20:19 +03:00
parent 2712c6682e
commit 30fa107ef7
120 changed files with 2471 additions and 1949 deletions

View File

@@ -105,6 +105,7 @@ def _target_to_response(target) -> OutputTargetResponse:
adaptive_fps=target.adaptive_fps,
protocol=target.protocol,
description=target.description,
tags=getattr(target, 'tags', []),
created_at=target.created_at,
updated_at=target.updated_at,
@@ -117,6 +118,7 @@ def _target_to_response(target) -> OutputTargetResponse:
picture_source_id=target.picture_source_id,
key_colors_settings=_kc_settings_to_schema(target.settings),
description=target.description,
tags=getattr(target, 'tags', []),
created_at=target.created_at,
updated_at=target.updated_at,
@@ -127,6 +129,7 @@ def _target_to_response(target) -> OutputTargetResponse:
name=target.name,
target_type=target.target_type,
description=target.description,
tags=getattr(target, 'tags', []),
created_at=target.created_at,
updated_at=target.updated_at,
@@ -169,6 +172,7 @@ async def create_target(
picture_source_id=data.picture_source_id,
key_colors_settings=kc_settings,
description=data.description,
tags=data.tags,
)
# Register in processor manager
@@ -287,6 +291,7 @@ async def update_target(
protocol=data.protocol,
key_colors_settings=kc_settings,
description=data.description,
tags=data.tags,
)
# Detect KC brightness VS change (inside key_colors_settings)
@@ -461,11 +466,11 @@ async def get_target_colors(
r=r, g=g, b=b,
hex=f"#{r:02x}{g:02x}{b:02x}",
)
from datetime import datetime
from datetime import datetime, timezone
return KeyColorsResponse(
target_id=target_id,
colors=colors,
timestamp=datetime.utcnow(),
timestamp=datetime.now(timezone.utc),
)
except ValueError as e:
raise HTTPException(status_code=404, detail=str(e))