Favorites: star files, Favorites sidebar view (per-user, server-side) #296

Closed
opened 2026-08-20 20:40:22 +00:00 by Cordy · 2 comments
Owner

Request (2026-08-20, Nikola): similar to Recents, tagging files as favorites. Mockup approved 2026-08-20 (ships together with #295).

Design — mirrors the #293 recents architecture:

  • internal/favorites statestore: per-user ordered set of {Path, Name, At} (added-time, newest first), atomic JSON at <state dir>/favorites.json. Case-insensitive dedupe. Soft cap 200 per user (refuse beyond with a friendly message — keeps the listing cheap).
  • API: GET /api/v1/favorites (existence-filtered via scoped Stat like recents — deleted/revoked entries drop off), POST /api/v1/favorites?path= (add), DELETE /api/v1/favorites?path= (remove). Nil-safe handler field + narrow interface, same pattern as RecentsStore.
  • Unlike recents, favorites can include folders (starring a project folder is a core use case); the listing keeps directory rows navigable.
  • UI: star toggle in the row hover actions and in the preview-panel header (#295); filled amber star on favorited rows in every listing; Favorites nav entry (star icon) between Recents and Spaces; files-style view newest-starred first with path sublines; custom empty state.
  • i18n ×4.

Per-user only — nobody sees another user's stars; no admin surface.

**Request (2026-08-20, Nikola):** similar to Recents, tagging files as favorites. Mockup approved 2026-08-20 (ships together with #295). **Design — mirrors the #293 recents architecture:** - `internal/favorites` statestore: per-user ordered set of `{Path, Name, At}` (added-time, newest first), atomic JSON at `<state dir>/favorites.json`. Case-insensitive dedupe. Soft cap 200 per user (refuse beyond with a friendly message — keeps the listing cheap). - API: `GET /api/v1/favorites` (existence-filtered via scoped `Stat` like recents — deleted/revoked entries drop off), `POST /api/v1/favorites?path=` (add), `DELETE /api/v1/favorites?path=` (remove). Nil-safe handler field + narrow interface, same pattern as `RecentsStore`. - Unlike recents, favorites can include **folders** (starring a project folder is a core use case); the listing keeps directory rows navigable. - UI: star toggle in the row hover actions and in the preview-panel header (#295); filled amber star on favorited rows in every listing; **Favorites** nav entry (star icon) between Recents and Spaces; files-style view newest-starred first with path sublines; custom empty state. - i18n ×4. Per-user only — nobody sees another user's stars; no admin surface.
Author
Owner

Shipped as v0.6.57 (PR #298), live on both dogfoods.

What changed:

  • Star any file or folder from the star in its row actions, or from the preview-panel header (#295). Starred items show a filled amber star next to their name in every listing.
  • New Favorites view in the sidebar (star icon, under Recents): your starred items, newest-starred first, with path sublines; folder rows navigate into the folder.
  • Per-user and server-side (favorites.json beside the other runtime state) — stars follow you across browsers/devices; nobody else sees yours. Deleted or access-revoked items drop off automatically. Capped at 200 per user (friendly error beyond).

Dogfood checklist:

  • Star a file from its row → filled amber star appears; unstar → gone
  • Star a folder → appears in Favorites; clicking it there navigates into it
  • Star from the preview-panel header — row star and panel star stay in sync
  • Favorites view lists newest-starred first with paths
  • Reload the page → stars still shown on the right rows (first-paint sync)
  • Second browser/session → same stars
  • nikola-test (on bao) sees only their own favorites
  • Delete (trash) a starred file → it disappears from Favorites
  • Empty state shows the "Nothing starred yet…" message
Shipped as **v0.6.57** (PR #298), live on both dogfoods. **What changed:** - Star any file **or folder** from the star in its row actions, or from the preview-panel header (#295). Starred items show a filled amber star next to their name in every listing. - New **Favorites** view in the sidebar (star icon, under Recents): your starred items, newest-starred first, with path sublines; folder rows navigate into the folder. - Per-user and server-side (`favorites.json` beside the other runtime state) — stars follow you across browsers/devices; nobody else sees yours. Deleted or access-revoked items drop off automatically. Capped at 200 per user (friendly error beyond). **Dogfood checklist:** - [ ] Star a file from its row → filled amber star appears; unstar → gone - [ ] Star a folder → appears in Favorites; clicking it there navigates into it - [ ] Star from the preview-panel header — row star and panel star stay in sync - [ ] Favorites view lists newest-starred first with paths - [ ] Reload the page → stars still shown on the right rows (first-paint sync) - [ ] Second browser/session → same stars - [ ] nikola-test (on bao) sees only their own favorites - [ ] Delete (trash) a starred file → it disappears from Favorites - [ ] Empty state shows the "Nothing starred yet…" message
Author
Owner

Closing — verified on the dogfood (shipped v0.6.57, PR #298).

Closing — verified on the dogfood (shipped v0.6.57, PR #298).
Cordy closed this issue 2026-08-26 17:40:12 +00:00
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#296
No description provided.