From eddb69e58eae7650ffac3b2e814c0ef0c5b6c76e Mon Sep 17 00:00:00 2001 From: bruno Date: Fri, 10 Jul 2026 20:10:35 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20workspace=20page=20redesign=20=E2=80=94?= =?UTF-8?q?=20modals,=20folder=20distinction,=20no=20duplication?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- app/routers/dashboard.py | 6 +- app/templates/local_workspace.html | 280 +++++++++++++++++++---------- 2 files changed, 185 insertions(+), 101 deletions(-) diff --git a/app/routers/dashboard.py b/app/routers/dashboard.py index 283f9ce..db3508b 100644 --- a/app/routers/dashboard.py +++ b/app/routers/dashboard.py @@ -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} diff --git a/app/templates/local_workspace.html b/app/templates/local_workspace.html index b1a6f6e..0f5d86a 100644 --- a/app/templates/local_workspace.html +++ b/app/templates/local_workspace.html @@ -1,15 +1,16 @@ {% extends "base.html" %} -{% block page_title %}My Workspace{% endblock %} +{% block page_title %}{{ workspace_name }}{% endblock %} {% block page_icon %}📁{% endblock %} {% block topbar %}
- Workspace - {{ workspace_name }} + {{ workspace_name }} + Files
- + +
{% endblock %} @@ -17,141 +18,222 @@ {% block content %} -
+

📁 {{ workspace_name }}

-

{{ items | length }} item(s)

+

{{ items | length }} item(s)

- -
- - -
- - -
- -
-
📁
+
+
📁

Empty workspace

-

Create a new file or folder to get started

-
- - +

Create a new file to start writing, or a folder to organize your content

+
+ + +
+
+ + + + + + + + + + + +