Recents: last 15 opened/downloaded files as a sidebar view #293
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Cordy/Cairn#293
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Request (2026-08-20, Nikola): a "Recents" quicklink in the left navbar for the last 10–15 files the user opened/downloaded.
Design (server-side, per-user — follows across devices):
internal/recentsstore on the statestore pattern (clone ofnotify):map[user][]entry{Path, Name, At};Record(user, path, name)dedupes to front and caps at 15; atomic JSON at<state dir>/recents.json, encrypted like the other runtime state.GET /api/v1/files/raw) — the single path the web UI uses for both opening and downloading a file. Nil-safe field on the API handler; wired unconditionally in main (not inside the peering block). WebDAV opens are out of scope v1 (sync clients would flood the list with automatic reads).GET /api/v1/recents: the caller's list, existence-filtered at read time via a scopedStat(≤15 stats, cheap) so deleted/moved files silently drop out; entries return the fresh FileInfo (size, modTime) so rows render like any listing.renderRows+showPath), rows fully functional (open = re-records). Custom empty state ("Nothing opened yet").Privacy note: the list is the user's own activity, visible only to them via their own endpoint; admins do not get a cross-user surface here (the audit log already covers governance needs).
Mockup-first per house process.
Shipped as v0.6.56 (PR #294), live on both dogfoods.
What changed:
recents.json), so it survives redeploys.Dogfood checklist:
Dogfood verified by Nikola on both instances (v0.6.56) — Recents behaves as designed. Closing.
Solution summary: new
internal/recentsstatestore (atomic JSON viastatestore, per-user, cap 15, case-insensitive dedupe-to-front), recorded in the raw-download handler only (WebDAV deliberately excluded).GET /api/v1/recentsre-Stats each path through the caller's scoped store so vanished/revoked entries self-clean. Sidebar entry (clock icon) + files-style view, i18n ×4. Wired via the narrowRecentsStoreinterface to keepinternal/apiimport-clean. Covered byTestRecordDedupeCapOrder/TestPersistenceRoundTrip.