fix: Library button preserves workspace context
FlowDeck CI / test (push) Failing after 4s
FlowDeck CI / docker (push) Has been skipped

3 bugs fixed:
1. dashboard.py /library was registered before board.router and had no workspace context → removed old endpoint, re-added with owner/repo params using board._sidebar_data()
2. base.html navigateTo('/library') lost workspace → now auto-appends ?owner=X&repo=Y from workspaceKey
3. openLibrary(id) used bare window.location.href → now uses this.navigateTo()

Now the Library page:
- Shows pages filtered by workspace when coming from a project
- Preserves the sidebar context (no more Admin Dashboard fallback)
- Tabs (Recents, Favorites, Shared, Private) display project pages from DB
This commit is contained in:
2026-07-10 09:19:47 -04:00
parent 3ed2181e89
commit a251ccfe2d
3 changed files with 92 additions and 18 deletions
+6 -1
View File
@@ -455,6 +455,11 @@
},
navigateTo(url) {
// Preserve workspace context when navigating to library/trash
if ((url === '/library' || url === '/trash') && this.workspaceKey && this.workspaceKey.includes('/')) {
const parts = this.workspaceKey.split('/');
url = `${url}?owner=${parts[0]}&repo=${parts.slice(1).join('/')}`;
}
window.location.href = url;
},
@@ -538,7 +543,7 @@
},
openLibrary(id) {
window.location.href = '/library';
this.navigateTo('/library');
},
openInLibrary(id) { this.openLibrary(id); },
showMore(id) { console.log('Show more:', id); },