feat: sidebar Repository identique au Workspace-local, pages forge unifiees, GC miroirs vides
FlowDeck CI / lint (push) Successful in 1m37s
FlowDeck CI / test (push) Successful in 25m11s
FlowDeck CI / docker (push) Successful in 1m32s

This commit is contained in:
2026-10-09 22:33:34 -04:00
parent 9ea0cddf3c
commit d95178156f
13 changed files with 1110 additions and 175 deletions
+27 -3
View File
@@ -395,9 +395,33 @@ def sidebar_workspace_tree(request: Request):
if not ws_cookie:
return HTMLResponse('<li class="sidebar-item empty-hint"><span class="page-icon">📄</span><span class="page-name text-dim">No pages yet</span></li>')
# Gitea workspace — no server-side tree, loaded client-side
if ws_cookie.startswith("gitea:"):
return HTMLResponse('<li class="sidebar-item empty-hint"><span class="page-icon">🔗</span><span class="page-name text-dim">Remote workspace</span></li>')
# Forge workspace (Gitea/GitHub) — the sidebar Workspace section shows the
# LOCAL mirror of the repository (the "parallel local workspace"), not a
# remote placeholder. Older behaviour returned "Remote workspace", which
# wiped the mirror tree on every CRUD refresh.
if ws_cookie.startswith("gitea:") or ws_cookie.startswith("github:"):
parts = ws_cookie.split(":", 2)
if len(parts) >= 3:
mirror = None
with get_conn() as conn:
mirror = conn.execute(
"SELECT id FROM workspaces WHERE owner_id=? AND name=? "
"AND (settings_json LIKE '%gitea_repo%' OR settings_json LIKE '%github_repo%')",
(user["id"], f"{parts[1]}/{parts[2]}"),
).fetchone()
if mirror:
pages = _load_workspace_pages(str(mirror["id"]))
if pages:
env = ENV
template = env.from_string(
"{% from '_workspace_tree_macro.html' import render_workspace_tree %}"
"{{ render_workspace_tree(pages) }}"
)
return HTMLResponse(template.render(pages=pages))
return HTMLResponse(
'<li class="sidebar-item empty-hint"><span class="page-icon">📄</span>'
'<span class="page-name text-dim">No pages yet</span></li>'
)
try:
ws_id = int(ws_cookie)