feat: focus priority, focus links, task list assignment, lists drag-and-drop, URL display fixes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 22:19:15 +00:00
parent 931abf2abd
commit 2e919d458b
12 changed files with 291 additions and 19 deletions

View File

@@ -235,6 +235,7 @@ async def task_detail(
# Tab-specific data
tab_data = []
all_contacts = []
all_lists = []
if tab == "notes":
result = await db.execute(text("""
@@ -268,6 +269,13 @@ async def task_detail(
ORDER BY l.sort_order, l.created_at DESC
"""), {"tid": task_id})
tab_data = [dict(r._mapping) for r in result]
# Available lists for add dropdown (not already assigned to this task)
result = await db.execute(text("""
SELECT id, name FROM lists
WHERE is_deleted = false AND (task_id IS NULL OR task_id != :tid)
ORDER BY name
"""), {"tid": task_id})
all_lists = [dict(r._mapping) for r in result]
elif tab == "decisions":
result = await db.execute(text("""
@@ -315,7 +323,7 @@ async def task_detail(
"request": request, "sidebar": sidebar, "item": item,
"domain": domain, "project": project, "parent": parent,
"subtasks": subtasks, "tab": tab, "tab_data": tab_data,
"all_contacts": all_contacts, "counts": counts,
"all_contacts": all_contacts, "all_lists": all_lists, "counts": counts,
"running_task_id": running_task_id,
"page_title": item["title"], "active_nav": "tasks",
})
@@ -471,6 +479,31 @@ async def quick_add(
# ---- Contact linking ----
@router.post("/{task_id}/lists/add")
async def add_list_to_task(
task_id: str,
list_id: str = Form(...),
db: AsyncSession = Depends(get_db),
):
await db.execute(text(
"UPDATE lists SET task_id = :tid, updated_at = now() WHERE id = :lid"
), {"tid": task_id, "lid": list_id})
await db.commit()
return RedirectResponse(url=f"/tasks/{task_id}?tab=lists", status_code=303)
@router.post("/{task_id}/lists/{list_id}/remove")
async def remove_list_from_task(
task_id: str, list_id: str,
db: AsyncSession = Depends(get_db),
):
await db.execute(text(
"UPDATE lists SET task_id = NULL, updated_at = now() WHERE id = :lid AND task_id = :tid"
), {"tid": task_id, "lid": list_id})
await db.commit()
return RedirectResponse(url=f"/tasks/{task_id}?tab=lists", status_code=303)
@router.post("/{task_id}/contacts/add")
async def add_contact(
task_id: str,