feat: critical flag toggle on focus items

Adds a clickable flag marker (⚑) on each focus row to mark items as
critical. Red when active, subtle when inactive. Toggle via POST.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 22:38:12 +00:00
parent 6abef336c4
commit 865d0870d7
2 changed files with 16 additions and 2 deletions

View File

@@ -592,6 +592,15 @@ async def toggle_focus(focus_id: str, request: Request, db: AsyncSession = Depen
return RedirectResponse(url=referer, status_code=303)
@router.post("/{focus_id}/toggle-critical")
async def toggle_critical(focus_id: str, request: Request, db: AsyncSession = Depends(get_db)):
repo = BaseRepository("daily_focus", db)
item = await repo.get(focus_id)
if item:
await repo.update(focus_id, {"critical": not item.get("critical", False)})
return RedirectResponse(url="/focus", status_code=303)
@router.post("/{focus_id}/remove")
async def remove_from_focus(focus_id: str, request: Request, db: AsyncSession = Depends(get_db)):
repo = BaseRepository("daily_focus", db)