From ca144e29d16d5725d5f86c6adbdf66dd7fc9dd6c Mon Sep 17 00:00:00 2001 From: bruno Date: Fri, 10 Jul 2026 15:04:50 -0400 Subject: [PATCH] feat: shared pages now appear in sidebar Shared section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pages with share_mode='anyone' or published=1 are now listed in the left sidebar Shared section. Icon shows 🌐 for published pages, 🔗 for anyone-with-link pages. Updated _sidebar_data() to query the pages table for shared/published pages. --- app/routers/board.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/app/routers/board.py b/app/routers/board.py index 7755626..c1e5f3c 100644 --- a/app/routers/board.py +++ b/app/routers/board.py @@ -193,10 +193,31 @@ def _sidebar_data(request: Request, owner: str = "", repo: str = "") -> dict: "children": [], }) + # Load shared pages (anyone with link or published) + with get_conn() as conn: + shared_rows = conn.execute( + "SELECT id, title, workspace, share_mode, published FROM pages " + "WHERE share_mode='anyone' OR published=1 ORDER BY updated_at DESC LIMIT 20" + ).fetchall() + shared_pages = [] + for r in shared_rows: + shared_pages.append({ + "id": f"page/{r['id']}", + "db_id": r["id"], + "name": r["title"] or "New page", + "icon": "🌐" if r["published"] else "🔗", + "url": f"/pages/{r['id']}", + "active": False, + "indent": 0, + "depth": 0, + "has_children": False, + "children": [], + }) + return {"workspace_name": ws_name, "workspace_initial": ws_name[0].upper() if ws_name else "B", "current_page": repo or "Dashboard", "last_edited": "now", "recent_pages": recent, "private_pages": private_items, - "favorite_pages": favorites, "shared_pages": [], + "favorite_pages": favorites, "shared_pages": shared_pages, "user": user, "workspace_key": ws_key}