Messenger & Communication Platform
A full messaging product — direct conversations, group channels, media galleries and live presence — where every interaction has to feel instant while the underlying socket stream never stops moving.
Problem space
- Conversation histories long enough that naive rendering stalls the main thread.
- Messages that are not one shape: text, media, attachments, replies, system events.
- Media whose height is unknown until it loads, inside a list that must not jump.
- A socket stream and a REST history that can disagree, reorder or arrive twice.
- Sending that must feel immediate while the server is still confirming it.
What I built
- Implemented virtualized conversation lists so only the visible window mounts, keeping scroll responsive as history grows.
- Reserved measured space for media before decode to eliminate layout shift and scroll-anchor jumps in the message stream.
- Built a normalized Pinia store keyed by conversation and message id so socket events, pagination and optimistic writes reconcile into one source of truth.
- Added optimistic send with server reconciliation and rollback, removing the perceived round-trip on every outgoing message.
- Reduced re-render overhead by splitting message rendering into memoized, type-dispatched components instead of one branching template.
- Centralised socket lifecycle — reconnect, resubscribe, replay missed events — behind a composable so views stay declarative.
Engineering detail
Dynamic heights inside a virtualized list
Virtualization wants fixed, known row heights. A messenger has neither: a photo resolves after decode, a text bubble reflows on resize, and users scroll upward into history. The list keeps a measurement cache per message id, seeds it from intrinsic media dimensions so the placeholder is already the right size, and re-measures through a ResizeObserver — patching offsets while pinning the scroll anchor to the message the user is actually reading.