Skip to content

v1.7.174

tagged this 05 Jul 19:40
langust verified the flag-based dedup still doubled the chrome. Their
diagnosis was right: Phoenix builds the native :layout before forcing
the lazy @inner_content, so app_layout's flag-set (which happens inside
that closure) is never visible when the adapter checks it. Runtime
coordination between the two layout applications is impossible.

Fix it structurally instead. app.html.heex (the default :layout) is
already a pure passthrough, and every full-page LiveView applies the
host layout itself via app_layout. So make the native :layout ALWAYS
the passthrough {PhoenixKitWeb.Layouts, :app} — app_layout becomes the
single owner of the host layout, applied exactly once. No adapter, no
flag, order-independent.

app_layout now hands the host layout BOTH a real inner_block slot and a
lazily-derived @inner_content (ensure_inner_content_from_block/1), so a
host layout works whether it uses {@inner_content} or
render_slot(@inner_block). Keeps the earlier correctness fixes
(has_inner_block? strict boolean; %Rendered{} not raw-wrapped;
assign/3 for change-tracking). Hosts can drop their double-wrap
workarounds.

Test rewritten to cover apply_host_layout/3: both conventions render
the body exactly once (2/2 pass). Precommit green. Needs langust to
confirm connected-update behavior against their real app.
Assets 2
Loading