Social Posts
This document covers the current implementation of the Posts screen in apps/frontend.
Status
- Route:
/posts - Route wrapper:
apps/frontend/src/routes/posts/SocialPostsRoute.tsx - Feature page:
apps/frontend/src/features/posts/components/PostsPage.tsx - Storybook:
apps/frontend/src/features/posts/components/PostsPage.stories.tsx - Tests:
apps/frontend/src/features/posts/components/PostsPage.test.tsx
UX Model
The page uses a list-and-editor layout:
- Left: search + filters + post queue cards
- Right: editable post form (content, platforms, mode, schedule)
- Header actions: refresh and create draft
Primary behavior is manual posting:
- "Copy & Post" opens native platform compose intents.
- Manual publish is recorded with
/api/social-posts/:id/manual-record. - Direct network auto-publish remains future work (#210).
Data and Persistence
- If
auth_tokenis present, data syncs with backend. - Without token, page falls back to local demo seed data for safe local development.
- Selected post and editor baseline are tracked to support dirty-state save/revert behavior.
API Usage
Frontend calls:
GET /api/social-postsPOST /api/social-postsPUT /api/social-posts/:idDELETE /api/social-posts/:idPOST /api/social-posts/batch-schedulePOST /api/social-posts/:id/manual-record
Implementation Notes
- Supported platform enum in frontend:
linkedin | twitter | instagram | facebook. editor.modedrives save behavior:draft-> saved as draftschedule-> scheduled timestamp required
- Status chips and list selection styling should always communicate active/selected state clearly.
Migration Guardrails
- Do not reintroduce legacy
/social-posts-v2route in docs as the primary path. - Keep API payload mapping helpers near the page (
fromBackend,toInputDateTime) to avoid drift. - Any future publishing behavior change must update both client + internal docs in the same PR.