Skip to content

FragmentSwapPolicy

FragmentSwapPolicy = "always" | "before-paint" | "never"

Defined in: fragments.ts:67

When a late response may replace copy already on screen.

"before-paint" — swap if the response beat the fallback onto the canvas; a LATER response only when the layout gate proves, against the computed style on your page, that the replacement cannot move anything (LAYOUT-DOCTRINE.md layer 2). The default for cta and label, because relabelling a button under a moving cursor produces a misclick rather than an adaptation.

"always" — take the single permitted swap whenever the response lands. The default for headline, body and empty-state.

"never" — a late response never replaces painted copy, gate or no gate: only a response that beat the fallback onto the canvas shows. This is exactly what "before-paint" meant before the gate existed (0.3.0) — the opt-out for copy whose WORDS must not change under a reader, which is a promise geometry cannot verify.

Set it per field to override either default. Presentation only: it never reaches the wire and never enters the schema hash.