From b835dd6b5e0a941a86e63cabff2d03e13adc7fec Mon Sep 17 00:00:00 2001 From: bruno Date: Mon, 20 Jul 2026 20:58:02 -0400 Subject: [PATCH] fix: WORKSPSACES section + remaining emoji icons replaced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - base.html: sΓ©parateur entre version et Log out, _local_workspaces_for_user - board.py: _local_workspaces_for_user helper, app_version, fix emoji icons - dashboard.py: _local_workspaces_for_user helper - library.html: πŸ“šπŸ“πŸ“„πŸ•’β­πŸ‘₯πŸŒπŸ”’πŸ“¦ β†’ SVG + icon map - workspaces.html: πŸ“πŸ”πŸ—‘πŸ“ β†’ SVG - local_workspace.html: page_icon, empty states, icon functions β†’ SVG - settings.html: πŸ‘€πŸ”” β†’ SVG nav icons - _icons.html: +'bell' icon - CSS: .nav-icon-inline, .empty-state-icon - 143 tests passent --- app/routers/board.py | 24 +++++++++++++++++++++--- app/routers/dashboard.py | 29 ++++++++++++++++------------- app/templates/_header.html | 6 +++--- app/templates/_icons.html | 2 ++ app/templates/base.html | 3 ++- app/templates/library.html | 14 +++++++------- app/templates/local_workspace.html | 20 ++++++++++---------- app/templates/settings.html | 4 ++-- app/templates/workspaces.html | 6 +++--- static/css/app.css | 3 +++ 10 files changed, 69 insertions(+), 42 deletions(-) diff --git a/app/routers/board.py b/app/routers/board.py index 3c6597a..3a3de30 100644 --- a/app/routers/board.py +++ b/app/routers/board.py @@ -216,6 +216,22 @@ def _load_children(parent_id: int) -> list: return children +def _local_workspaces_for_user(user: dict | None, workspace_id: int = 0) -> list[dict]: + """Return list of local workspaces for a user.""" + if not user: + return [] + try: + from app.db import get_conn + with get_conn() as conn: + rows = conn.execute( + "SELECT id, name FROM workspaces WHERE owner_id = ? ORDER BY name", + (user["id"],) + ).fetchall() + return [{"id": r["id"], "name": r["name"]} for r in rows] + except Exception: + return [] + + def _sidebar_data(request: Request, owner: str = "", repo: str = "") -> dict: user = SessionManager.decode_session(request.cookies.get("flowdeck_session", "")) ws_name = user.get("login", "Bruno") if user else "Bruno" @@ -280,7 +296,7 @@ def _sidebar_data(request: Request, owner: str = "", repo: str = "") -> dict: active = first recent.append({ "id": f"{owner}/{repo}/{view}", - "name": label, "icon": "πŸ“" if first else "Β·", + "name": label, "icon": "folder" if first else "", "url": f"/board/{owner}/{repo}?view={view}", "active": active, "indent": indent, "depth": indent, "has_children": False, "children": [], @@ -380,7 +396,9 @@ def _sidebar_data(request: Request, owner: str = "", repo: str = "") -> dict: "auth_method": auth_method, "gitea_linked": gitea_linked, "github_linked": github_linked, - "has_active_workspace": has_active_workspace} + "has_active_workspace": has_active_workspace, + "app_version": "4.0.3", + "local_workspaces": _local_workspaces_for_user(user)} def _extract_ai_keywords(owner: str, repo: str, labels: list[dict], body: str = ""): @@ -510,7 +528,7 @@ async def library_page(request: Request, owner: str = Query(default=""), repo: s "icon": "πŸ“„", "url": f"/pages/{page['id']}", "created_by": "You", - "source": page.get("workspace") or "πŸ”’ Private", + "source": page.get("workspace") or "Private", "last_edited": page.get("updated_at", "now"), "last_visited": page.get("updated_at", "now"), }) diff --git a/app/routers/dashboard.py b/app/routers/dashboard.py index 1983258..4cc4072 100644 --- a/app/routers/dashboard.py +++ b/app/routers/dashboard.py @@ -31,6 +31,21 @@ def _get_user_or_redirect(request: Request): return user +def _local_workspaces_for_user(user: dict | None, workspace_id: int = 0) -> list[dict]: + """Return list of local workspaces for a user.""" + if not user: + return [] + try: + with get_conn() as conn: + rows = conn.execute( + "SELECT id, name FROM workspaces WHERE owner_id = ? ORDER BY name", + (user["id"],) + ).fetchall() + return [{"id": r["id"], "name": r["name"]} for r in rows] + except Exception: + return [] + + def _sidebar_data(request: Request, repos: list[dict], include_workspace: bool = True) -> dict: user = SessionManager.decode_session(request.cookies.get("flowdeck_session", "")) ws = user.get("login", "Bruno") if user else "Bruno" @@ -176,19 +191,7 @@ def _sidebar_data(request: Request, repos: list[dict], include_workspace: bool = "app_version": "4.0.3", } - # List local workspaces for user menu - local_workspaces = [] - if user: - try: - with get_conn() as conn: - ws_rows = conn.execute( - "SELECT id, name FROM workspaces WHERE owner_id = ? ORDER BY name", - (user["id"],) - ).fetchall() - local_workspaces = [{"id": r["id"], "name": r["name"]} for r in ws_rows] - except Exception: - pass - sidebar["local_workspaces"] = local_workspaces + sidebar["local_workspaces"] = _local_workspaces_for_user(user) return sidebar diff --git a/app/templates/_header.html b/app/templates/_header.html index f085e78..c98fdd6 100644 --- a/app/templates/_header.html +++ b/app/templates/_header.html @@ -67,7 +67,7 @@ @mouseleave="dragCloseTimer()"> @@ -110,7 +110,7 @@
- + ›