fix: Private tab in library now shows pages by parent_section, not workspace
Bug: lib_private filtered on p.source == '🔒 Private' which only matched pages
without a workspace. All pages have parent_section='Private' by default, so
filtering by source excluded them all.
Fix: add 'section' field to page dict from parent_section DB column,
filter lib_private by p.section == 'Private'
This commit is contained in:
@@ -105,6 +105,7 @@ async def library_page(request: Request, owner: str = Query(default=""), repo: s
|
||||
"source": r.get("workspace") or "🔒 Private",
|
||||
"last_edited": r.get("updated_at", "now"),
|
||||
"last_visited": r.get("updated_at", "now"),
|
||||
"section": r.get("parent_section", "Private"),
|
||||
}
|
||||
|
||||
all_pages = [to_page(r) for r in rows]
|
||||
@@ -136,7 +137,7 @@ async def library_page(request: Request, owner: str = Query(default=""), repo: s
|
||||
sidebar["lib_recent"] = all_pages
|
||||
sidebar["lib_favorites"] = lib_favs
|
||||
sidebar["lib_shared"] = []
|
||||
sidebar["lib_private"] = [p for p in all_pages if p.get("source") == "🔒 Private"]
|
||||
sidebar["lib_private"] = [p for p in all_pages if p.get("section") == "Private"]
|
||||
sidebar["lib_has_favorites"] = len(lib_favs) > 0
|
||||
sidebar["lib_has_shared"] = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user