From 76131292041471c02cdc68b36b433afb75702501 Mon Sep 17 00:00:00 2001 From: bruno Date: Thu, 16 Jul 2026 13:44:10 -0400 Subject: [PATCH] fix: Gitea sidebar now has separate Repository section below Private Backend: - _sidebar_data() no longer clears workspace_pages for Gitea workspaces The local tree stays intact in the 'Private' section - workspace_pages is always loaded from DB (local files) Sidebar template (base.html): - Workspace section renamed to 'Private' when gitea_workspace is true - New 'Repository (Gitea)' section added below, visible only for Gitea workspaces, with its own toggle (sectionsOpen.gitea) and refresh button - Uses #sidebar-gitea-items container for the remote file tree Gitea workspace: - loadSidebarTree() now targets #sidebar-gitea-items - window._gwData exposed for sidebar refresh button - sectionsOpen now includes gitea: true by default --- app/routers/dashboard.py | 3 ++- app/templates/base.html | 26 +++++++++++++++++++++++--- app/templates/gitea_workspace.html | 14 ++++++++------ 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/app/routers/dashboard.py b/app/routers/dashboard.py index 0214ee3..5529d27 100644 --- a/app/routers/dashboard.py +++ b/app/routers/dashboard.py @@ -76,13 +76,14 @@ def _sidebar_data(request: Request, repos: list[dict], include_workspace: bool = if include_workspace and ws_cookie and ws_cookie.startswith("gitea:"): # Gitea workspace: set owner/repo for client-side tree loading + # BUT keep local workspace pages — they go in the "Private" section parts = ws_cookie.split(":", 2) if len(parts) >= 3: gitea_owner = parts[1] gitea_repo = parts[2] active_ws_name = f"{gitea_owner}/{gitea_repo}" gitea_workspace = True - workspace_pages = [] # loaded client-side + # workspace_pages stays as-is (local tree, loaded above) elif include_workspace and ws_cookie and user: try: wsi = int(ws_cookie) diff --git a/app/templates/base.html b/app/templates/base.html index cc1cb4d..12b05ec 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -116,12 +116,12 @@