Change record status: 
Introduced in branch: 
3.1.x
Introduced in version: 
3.1.7
Description: 

ECA exposes two new htmx tokens, and two matching new options on the
HTMX request value condition (eca_htmx_header).

Token Condition value option Source header Contains
[htmx:source] source HX-Source The CSS selector of the element that triggered the request, for example button[name="first_item"].
[htmx:request_type] request_type HX-Request-Type Whether the request targets a full page or a fragment: full or partial.

Core version dependency

Both headers are sent by htmx 4, which ships with Drupal 12. On Drupal 11,
which ships htmx 3, neither header is sent and both tokens resolve to an
empty string
.

That emptiness is deliberate, not a gap. On Drupal 11 the tokens stay empty
even if an HX-Source header is present on the request, because
htmx 3 never sends one - a value arriving there came from somewhere else, such
as a proxy, and must not be trusted as if htmx had set it.

Write models that use these tokens so they behave sensibly when the value is
empty, if the site may run on Drupal 11.

What you can do with them

[htmx:request_type] lets a model branch on whether it is
handling a full page load or a fragment swap, which previously could not be
determined. [htmx:source] gives the raw htmx 4 selector of the
triggering element, which is more specific than
[htmx:trigger] when several elements share an id or none is
set.

Nothing changes for the existing htmx tokens.

Impacts: 
Site builders, administrators, editors