fix: workspace name shows even empty, folders vs files, delete button
FlowDeck CI / test (push) Failing after 4s
FlowDeck CI / docker (push) Has been skipped

- dashboard.py _sidebar_data now reads active workspace cookie
- Workspace name always displays (even with 0 pages)
- Folders stored with parent_section='Workspace' (icon 📁)
- Files stored with parent_section='Private' (icon 📄)
- Delete button uses @click directive (not onclick app.)
- workspace_pages loaded in dashboard's _sidebar_data
This commit is contained in:
2026-07-10 19:59:34 -04:00
parent 1ae4aa4ab4
commit 1639884800
3 changed files with 31 additions and 10 deletions
+3 -2
View File
@@ -148,10 +148,11 @@ def _load_workspace_pages(ws_cookie: str) -> list:
ws_id = int(ws_cookie)
with get_conn() as conn:
rows = conn.execute(
"SELECT id, title FROM pages WHERE workspace_id=? AND parent_id IS NULL ORDER BY created_at DESC",
"SELECT id, title, parent_section FROM pages WHERE workspace_id=? AND parent_id IS NULL ORDER BY created_at DESC",
(ws_id,),
).fetchall()
return [{"db_id": r["id"], "name": r["title"] or "Untitled", "id": f"page/{r['id']}"} for r in rows]
return [{"db_id": r["id"], "name": r["title"] or "Untitled", "id": f"page/{r['id']}",
"icon": "📁" if r.get("parent_section") == "Workspace" else "📄"} for r in rows]
except (ValueError, Exception):
return []