Add Pattern Templates for Key Colors targets with visual canvas editor
Introduce Pattern Template entity as a reusable rectangle layout that Key Colors targets reference via pattern_template_id. This replaces inline rectangle storage with a shared template system. Backend: - New PatternTemplate data model, store (JSON persistence), CRUD API - KC targets now reference pattern_template_id instead of inline rectangles - ProcessorManager resolves pattern template at KC processing start - Picture source test endpoint supports capture_duration=0 for single frame - Delete protection: 409 when template is referenced by a KC target Frontend: - Pattern Templates section in Key Colors sub-tab with card UI - Visual canvas editor with drag-to-move, 8-point resize handles - Background capture from any picture source for visual alignment - Precise coordinate list synced bidirectionally with canvas - Resizable editor container, viewport-constrained modal - KC target editor uses pattern template dropdown instead of inline rects - Localization (en/ru) for all new UI elements Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -360,21 +360,41 @@
|
||||
"kc.interpolation.dominant": "Dominant",
|
||||
"kc.smoothing": "Smoothing:",
|
||||
"kc.smoothing.hint": "Temporal blending between extractions (0=none, 1=full)",
|
||||
"kc.rectangles": "Color Rectangles",
|
||||
"kc.rectangles.hint": "Define named rectangles in relative coordinates (0.0–1.0) on the captured image",
|
||||
"kc.rect.name": "Name",
|
||||
"kc.rect.x": "X",
|
||||
"kc.rect.y": "Y",
|
||||
"kc.rect.width": "W",
|
||||
"kc.rect.height": "H",
|
||||
"kc.rect.add": "Add Rectangle",
|
||||
"kc.rect.remove": "Remove",
|
||||
"kc.rect.empty": "No rectangles defined. Add at least one rectangle to extract colors.",
|
||||
"kc.pattern_template": "Pattern Template:",
|
||||
"kc.pattern_template.hint": "Select the rectangle pattern to use for color extraction",
|
||||
"kc.pattern_template.none": "-- Select a pattern template --",
|
||||
"kc.created": "Key colors target created successfully",
|
||||
"kc.updated": "Key colors target updated successfully",
|
||||
"kc.deleted": "Key colors target deleted successfully",
|
||||
"kc.delete.confirm": "Are you sure you want to delete this key colors target?",
|
||||
"kc.error.no_rectangles": "Please add at least one rectangle",
|
||||
"kc.error.no_pattern": "Please select a pattern template",
|
||||
"kc.error.required": "Please fill in all required fields",
|
||||
"kc.colors.none": "No colors extracted yet"
|
||||
"kc.colors.none": "No colors extracted yet",
|
||||
"targets.section.pattern_templates": "📄 Pattern Templates",
|
||||
"pattern.add": "📄 Add Pattern Template",
|
||||
"pattern.edit": "📄 Edit Pattern Template",
|
||||
"pattern.name": "Template Name:",
|
||||
"pattern.name.placeholder": "My Pattern Template",
|
||||
"pattern.description_label": "Description (optional):",
|
||||
"pattern.description_placeholder": "Describe this pattern...",
|
||||
"pattern.rectangles": "Rectangles",
|
||||
"pattern.rect.name": "Name",
|
||||
"pattern.rect.x": "X",
|
||||
"pattern.rect.y": "Y",
|
||||
"pattern.rect.width": "W",
|
||||
"pattern.rect.height": "H",
|
||||
"pattern.rect.add": "Add Rectangle",
|
||||
"pattern.rect.remove": "Remove",
|
||||
"pattern.rect.empty": "No rectangles defined. Add at least one rectangle.",
|
||||
"pattern.created": "Pattern template created successfully",
|
||||
"pattern.updated": "Pattern template updated successfully",
|
||||
"pattern.deleted": "Pattern template deleted successfully",
|
||||
"pattern.delete.confirm": "Are you sure you want to delete this pattern template?",
|
||||
"pattern.delete.referenced": "Cannot delete: this template is referenced by a target",
|
||||
"pattern.error.required": "Please fill in all required fields",
|
||||
"pattern.visual_editor": "Visual Editor",
|
||||
"pattern.capture_bg": "Capture Background",
|
||||
"pattern.source_for_bg": "Source for Background:",
|
||||
"pattern.source_for_bg.none": "-- Select source --",
|
||||
"pattern.delete_selected": "Delete Selected"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user