feat: fix favorites display and add star indicator on favorited items

- Add ?metadata=true support to GET /api/files/{id} to return JSON metadata
  instead of binary content (was the root cause of favorites not loading)
- Fix favorites loadFileDetails to use metadata endpoint with auth headers
- Add star icon on favorited files/folders in grid view (top-left corner)
- Add star icon on favorited files/folders in list view (next to name)
- Refresh file view when toggling favorites so star appears/disappears
- Add CSS styles for .favorite-star and .favorite-star-inline
This commit is contained in:
Dionisio
2026-02-13 09:32:16 +01:00
parent fb65d1976b
commit 5c53d94c0c
4 changed files with 83 additions and 23 deletions
+37
View File
@@ -92,4 +92,41 @@
.favorite-indicator.active {
animation: favorite-pulse 0.3s ease;
}
/* ── Star badge on file/folder cards (normal view) ── */
/* Grid view: star in top-left corner */
.file-card .favorite-star {
position: absolute;
top: 8px;
left: 8px;
font-size: 14px;
color: #ffc107;
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
z-index: 5;
pointer-events: none;
[dir='rtl'] & {
left: unset;
right: 8px;
}
}
.file-card .favorite-star.active i {
animation: favorite-pulse 0.3s ease;
}
/* List view: small star next to the name */
.favorite-star-inline {
color: #ffc107;
font-size: 11px;
margin-left: 6px;
vertical-align: middle;
filter: drop-shadow(0 0 1px rgba(255, 193, 7, 0.4));
[dir='rtl'] & {
margin-left: 0;
margin-right: 6px;
}
}