feat: focus priority, focus links, task list assignment, lists drag-and-drop, URL display fixes
- Focus page: turn sequence number into persistent editable priority (focus_priority column) - Focus detail: add links section (add existing, create new, unlink) via focus_links junction table - Focus detail: add copy and inline edit for checklist items - Task detail lists tab: add existing list assignment and unlink actions - Lists page: add drag-and-drop reorder support - Links/bookmarks pages: remove artificial URL truncation, use CSS ellipsis Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user