Auto-populate activity log from timer events with edit and delete

- New GET /api/logs/timeline endpoint joins TimerEvent with block/subject/session data
- New PATCH and DELETE /api/logs/timeline/{id} endpoints for editing/removing events
- LogView redesigned as a chronological timeline grouped by date
- Edit inline: timer events support type + time correction; notes support text edit
- Delete works for both auto events and manual notes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 18:15:35 -08:00
parent fc9413924d
commit fef03ec538
3 changed files with 403 additions and 72 deletions

View File

@@ -1,4 +1,4 @@
from datetime import date
from datetime import date, datetime
from pydantic import BaseModel
@@ -27,3 +27,21 @@ class ActivityLogOut(BaseModel):
duration_minutes: int | None
model_config = {"from_attributes": True}
class TimelineEventUpdate(BaseModel):
event_type: str | None = None
occurred_at: datetime | None = None
class TimelineEventOut(BaseModel):
id: int
event_type: str
occurred_at: datetime
session_date: date
child_id: int
child_name: str
block_label: str | None = None
subject_name: str | None = None
subject_icon: str | None = None
subject_color: str | None = None