feat: per-task image/annotations, annotation editor toolbar, Tailwind compiled
- Add per-task file upload with image preview in task editor - Add dedicated annotation editor page (task_drawing.html) with Fabric.js - Add color picker, stroke width, and line dash controls to annotation toolbar - Apply property changes to selected objects in real-time - Disable style controls until a drawing tool or object is selected - Remove zoom/pan from annotation toolbar (simplified UX) - Auto-switch to select mode after placing annotation elements - Show annotation overlay on task image previews (read-only canvas) - Add file proxy route in measure blueprint for task file access - Add file_path/file_type fields to TaskCreate/TaskUpdate Pydantic schemas - Replace Tailwind CDN with compiled CSS (tailwind.config.js with full shades) - Fix Alpine.js x-init crash: extract annotations JSON to <script> tags (recipe_preview.html, task_execute.html) to avoid HTML attribute breakage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,7 @@ class TaskCreate(BaseModel):
|
||||
title: str = Field(..., min_length=1, max_length=255)
|
||||
directive: Optional[str] = None
|
||||
description: Optional[str] = None
|
||||
file_path: Optional[str] = Field(None, max_length=500)
|
||||
file_type: Optional[str] = Field(None, pattern="^(image|pdf)$")
|
||||
annotations_json: Optional[dict[str, Any]] = None
|
||||
subtasks: list[SubtaskCreate] = []
|
||||
@@ -61,6 +62,8 @@ class TaskUpdate(BaseModel):
|
||||
title: Optional[str] = Field(None, min_length=1, max_length=255)
|
||||
directive: Optional[str] = None
|
||||
description: Optional[str] = None
|
||||
file_path: Optional[str] = Field(None, max_length=500)
|
||||
file_type: Optional[str] = Field(None, pattern="^(image|pdf)$")
|
||||
annotations_json: Optional[dict[str, Any]] = None
|
||||
|
||||
|
||||
|
||||
@@ -381,10 +381,14 @@ async def list_recipes(
|
||||
pages = max(1, math.ceil(total / per_page))
|
||||
offset = (page - 1) * per_page
|
||||
|
||||
# Fetch recipes
|
||||
# Fetch recipes with versions and tasks for thumbnail display
|
||||
stmt = (
|
||||
select(Recipe)
|
||||
.where(*base_filter)
|
||||
.options(
|
||||
selectinload(Recipe.versions)
|
||||
.selectinload(RecipeVersion.tasks)
|
||||
)
|
||||
.order_by(Recipe.name.asc())
|
||||
.offset(offset)
|
||||
.limit(per_page)
|
||||
|
||||
Reference in New Issue
Block a user