feat: recursive tree, drag & drop, sub-folders in sidebar workspace
FlowDeck CI / test (push) Failing after 4s
FlowDeck CI / docker (push) Has been skipped

- _load_workspace_pages now recursively loads children via _load_children()
- Sidebar: recursive Jinja2 macro render_workspace_tree()
- Drag & drop: HTML5 DnD — drag files into folders or reorder
- move API: PUT /api/local-workspace/items/{id}/move
- Folder hover shows 📄 (new file) + 📁 (sub-folder) buttons
- newPageInFolder/newFolderInFolder with parent_id for nesting
- Visual: dragging opacity + drop target highlight
- Items indented by depth (16px per level)
This commit is contained in:
2026-07-10 21:22:11 -04:00
parent 373153de69
commit 1ab5b1271f
3 changed files with 132 additions and 11 deletions
+15
View File
@@ -581,6 +581,21 @@ async def delete_local_workspace_item(request: Request, item_id: int):
return {"status": "ok"}
@router.put("/api/local-workspace/items/{item_id:int}/move")
async def move_local_workspace_item(request: Request, item_id: int):
"""Move an item to a new parent (drag & drop)."""
import json
body = await request.json()
new_parent_id = body.get("parent_id") # None = move to root
with get_conn() as conn:
conn.execute(
"UPDATE pages SET parent_id=? WHERE id=?",
(new_parent_id, item_id),
)
conn.commit()
return {"status": "ok"}
# ═══════════ Workspaces CRUD ═══════════
WORKSPACE_COOKIE = "flowdeck_workspace"