New posts should appear without manual refresh.
Approaches:
- Polling: Check every seconds. Simple but delayed.
- WebSocket: Persistent connection. Real-time but complex.
- SSE: Server pushes updates. Good middle ground.
UX consideration: Don't auto-insert posts while reading. Show "X new posts" banner instead.
Implementation:
// Accumulate new posts
const [newPosts, setNewPosts] = useState([]);
// Show banner
{newPosts.length > 0 && (
<NewPostsBanner count={newPosts.length} onClick={insertPosts} />
)}