fix: workspace page redesign — modals, folder distinction, no duplication
- Complete redesign of local_workspace.html
- Modal dialogs (Create File, Create Folder, Rename, Delete) — no prompt()
- Folder creation fixed: parent_section='Workspace' → 📁 icon
- Tree API properly detects folders via parent_section
- No duplicate empty state — unified header + empty message
- Professional UI with backdrop blur, focus auto, disabled btn
This commit is contained in:
@@ -528,9 +528,11 @@ async def local_workspace_tree(request: Request):
|
||||
for r in roots:
|
||||
with get_conn() as conn:
|
||||
children = conn.execute(
|
||||
"SELECT id, title FROM pages WHERE parent_id=? ORDER BY created_at", (r["id"],)
|
||||
"SELECT id, title, parent_section FROM pages WHERE parent_id=? ORDER BY created_at", (r["id"],)
|
||||
).fetchall()
|
||||
item = {"id": r["id"], "name": r["title"] or "Untitled", "type": "page",
|
||||
is_folder = r.get("parent_section") == "Workspace"
|
||||
rtype = "folder" if is_folder else "page"
|
||||
item = {"id": r["id"], "name": r["title"] or "Untitled", "type": rtype,
|
||||
"children": [{"id": c["id"], "name": c["title"] or "Untitled", "type": "page"} for c in children]}
|
||||
tree.append(item)
|
||||
return {"tree": tree}
|
||||
|
||||
Reference in New Issue
Block a user