The mailbox — folder sidebar, message list, reading pane.
One LiveView, patched navigation
Everything except composing happens here. Which mailbox, which folder, and
which message is open are query params, read in handle_params/3;
clicking a folder or a message is a push_patch, not a navigate. That
keeps the socket (and the mailbox list, and the scroll position) alive across
every interaction the way a real webmail client does, and it makes every
view of the mailbox a shareable URL.
The render function follows the section-decomposition pattern from
phoenix_kit_hello_world's ComponentsLive: render/1 is a flat dispatch
over three panes, each a private function component declaring the assigns it
reads.
Access
Two gates, checked on every param change rather than only at mount — a user
can hand-edit ?mailbox= in the URL:
Scope.has_module_access?(scope, "inbox")— can they use Inbox at allMailboxes.authorize/3— can they open this mailbox