grain.social is a photo sharing platform built on atproto. grain.social
atproto photography appview
57
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: add story archive design

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+55
+55
docs/plans/2026-03-29-story-archive-design.md
··· 1 + # Story Archive Design 2 + 3 + ## Summary 4 + 5 + Add a private story archive on the user's own profile page, allowing them to browse and view all past stories (not just the last 24 hours). Old story records already persist in the database — this feature surfaces them. 6 + 7 + ## Data Layer 8 + 9 + **New XRPC endpoint: `social.grain.unspecced.getStoryArchive`** 10 + 11 + - Params: `actor` (DID, required), `limit` (default 50), `cursor` (string, optional) 12 + - Returns: `{ stories: StoryView[], cursor?: string }` 13 + - Same logic as `getStories` but without the 24-hour cutoff 14 + - Ordered by `created_at DESC` (newest first) 15 + - Cursor-based pagination (cursor is the `created_at` of the last item) 16 + - Applies label moderation (hide-severity filtering) and cross-post hydration 17 + 18 + Client query: `storyArchiveQuery(did, cursor?)` in `queries.ts`. 19 + 20 + ## UI 21 + 22 + **Entry point:** A button on the profile page, visible only when `isOwnProfile`. Small archive/clock icon with "Story Archive" label. 23 + 24 + **Archive grid:** Inline collapsible section on the profile page. 25 + 26 + - 3-column grid of square thumbnails using the story `thumb` URL 27 + - Date overlay on each thumbnail (e.g., "Mar 15") 28 + - Tap opens StoryViewer for that single story 29 + - Infinite scroll with cursor pagination 30 + - Empty state: "No stories yet" 31 + 32 + **StoryViewer adjustments:** 33 + 34 + - When opened from archive, show a single story (no author swiping) 35 + - Existing delete button works as-is 36 + - `timeAgo` updated to show full date (e.g., "Mar 15") for stories older than 24 hours 37 + 38 + ## Files 39 + 40 + **New:** 41 + - `server/xrpc/getStoryArchive.ts` 42 + - `lexicons/social/grain/unspecced/getStoryArchive.json` 43 + - `app/lib/components/molecules/StoryArchive.svelte` 44 + 45 + **Modified:** 46 + - `app/lib/queries.ts` — add `storyArchiveQuery` 47 + - `app/routes/profile/[did]/+page.svelte` — archive button + grid section 48 + - `app/lib/components/organisms/StoryViewer.svelte` — single-story mode, full date for old stories 49 + 50 + ## Out of Scope 51 + 52 + - Highlights / pinning stories to profile 53 + - Separate `/profile/{did}/stories` route 54 + - Retention limits or bulk delete 55 + - Archive visible to other users