diff --git a/app/routers/library.py b/app/routers/library.py index 86f82cb..d0ec287 100644 --- a/app/routers/library.py +++ b/app/routers/library.py @@ -445,7 +445,7 @@ async def library_workspace( source_type = "all" uid = _get_user_id(request) - query = f"{BASE_SELECT} FROM pages p WHERE p.workspace != '' AND p.parent_section != 'Trash' AND p.deleted_at IS NULL" + query = f"{BASE_SELECT} FROM pages p WHERE (p.workspace != '' OR p.workspace_id IS NOT NULL) AND p.parent_section != 'Trash' AND p.deleted_at IS NULL" params: list = [] if workspace_id: diff --git a/app/templates/library.html b/app/templates/library.html index 11bbe2a..4337b3d 100644 --- a/app/templates/library.html +++ b/app/templates/library.html @@ -464,14 +464,8 @@ function libraryPage() { try { var url = '/api/library/' + this.tab; var sep = '?'; - // Workspace tab: if local workspace is active, show local workspace items - if (this.tab === 'workspace' && this.workspaceId && !this.isGiteaActive) { - url = '/api/library/local-workspace' + sep + 'workspace_id=' + this.workspaceId; - sep = '&'; - } else { - if (this.workspaceId && (this.tab === 'recents')) { - url += sep + 'workspace_id=' + this.workspaceId; sep = '&'; - } + if (this.workspaceId && (this.tab === 'recents' || this.tab === 'workspace')) { + url += sep + 'workspace_id=' + this.workspaceId; sep = '&'; } if (this.tab === 'repository' && this.isGiteaActive) { url += sep + 'gitea_owner=' + encodeURIComponent(this.giteaOwner) + '&gitea_repo=' + encodeURIComponent(this.giteaRepo); @@ -528,12 +522,7 @@ function libraryPage() { this.expanded = Object.assign({}, this.expanded); if (!item.children || !item.children.length) { try { - // Route to correct children endpoint based on source type - var childrenUrl = '/api/library/children/' + item.id; - if (item.source_type === 'local-ws') { - childrenUrl = '/api/library/local-workspace-children/' + item.id; - } - var r = await fetch(childrenUrl); + var r = await fetch('/api/library/children/' + item.id); var d = await r.json(); item.children = d.items || []; // Mark the tree for depth calculation