Your root layout will be static. When you use <%= @inner_content %> within that layout it is a reference to the live.html.heex file / html / page. You need to structure the code / html in such a way that live components are confined to live.html.heex. Bearing in mind that whatever is there, in live.html.heex, liveview takes full control of. What that means practically is that you can not modify it directly with JS as liveview will overwrite those changes.
Basically I don’t understand why my flash message doesn’t show by default. Why do I need to manually add
<.flash_group flash={@flash} />
to my liveview when it is already in the root layout. For some reason the flash component in the root layout doesn’t show any flash message even when the socket updates.
The layout is static. Liveveiw has no control over it. So you remove it from the layout and add it to your liveview heex that liveview has control over. Why? I can only speculate. I do see the value in limiting liveviews control.