From 5bb02b7dd5d12831b59d5fa6c5d5e78f3f3ee00e Mon Sep 17 00:00:00 2001 From: giles Date: Wed, 4 Mar 2026 11:26:24 +0000 Subject: [PATCH] Move 7 htmx-equivalent attrs from SX_UNIQUE_ATTRS to BEHAVIOR_ATTRS These are sx implementations of htmx attributes (boost, preload, preserve, indicator, validate, ignore, optimistic), not unique to sx. Co-Authored-By: Claude Opus 4.6 --- sx/content/pages.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sx/content/pages.py b/sx/content/pages.py index 52b3198..bd3d549 100644 --- a/sx/content/pages.py +++ b/sx/content/pages.py @@ -113,10 +113,6 @@ BEHAVIOR_ATTRS = [ ("sx-media", "Only enable this element when the media query matches", True), ("sx-disable", "Disable sx processing on this element and its children", True), ("sx-on:*", "Inline event handler — e.g. sx-on:click runs JavaScript on event", True), -] - -SX_UNIQUE_ATTRS = [ - ("sx-retry", "Exponential backoff retry on request failure", True), ("sx-boost", "Progressively enhance all links and forms in a container with AJAX navigation", True), ("sx-preload", "Preload content on hover/focus for instant response on click", True), ("sx-preserve", "Preserve element across swaps — keeps DOM state, event listeners, and scroll position", True), @@ -124,6 +120,10 @@ SX_UNIQUE_ATTRS = [ ("sx-validate", "Run browser constraint validation (or custom validator) before sending the request", True), ("sx-ignore", "Ignore element and its subtree during morph/swap — no updates applied", True), ("sx-optimistic", "Apply optimistic UI updates immediately, reconcile on server response", True), +] + +SX_UNIQUE_ATTRS = [ + ("sx-retry", "Exponential backoff retry on request failure", True), ("data-sx", "Client-side rendering — evaluate the sx source in this attribute and render into the element", True), ("data-sx-env", "Provide environment variables as JSON for data-sx rendering", True), ]