fix: workspace name shows even empty, folders vs files, delete button
- 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:
@@ -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 []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user