feat(runtime): add URL-state GET navigation

This commit is contained in:
slhx agent
2026-06-29 18:21:00 +02:00
parent 9dd8e4a944
commit d0e7022c86
10 changed files with 185 additions and 97 deletions
+15
View File
@@ -1597,6 +1597,7 @@ fn known_hemx_attr(name: &str) -> bool {
| "data-hemx-disable-while-pending"
| "data-hemx-policy"
| "data-hemx-nav"
| "data-hemx-history"
| "data-hemx-boost"
| "data-hemx-error-for"
| "data-hemx-error"
@@ -1619,6 +1620,14 @@ fn reject_invalid_hemx_attr_values(path: &Path, attrs: &[SurfaceAttribute]) -> i
"expected one of `latest`, `queue`, `drop`, or `parallel`",
));
}
"data-hemx-history" if !matches!(value.trim(), "" | "push" | "replace") => {
return Err(invalid_hemx_value(
path,
&attr.name,
value,
"expected `push`, `replace`, or empty for the default push behavior",
));
}
"data-hemx-on" if !valid_event_list(value) => {
return Err(invalid_hemx_value(
path,
@@ -2820,6 +2829,12 @@ fn main() {{
"data-hemx-interval",
"1s",
),
(
"history",
r#"<form method="get" action="/search" data-hemx-history="append"><input name="q"></form>"#,
"data-hemx-history",
"replace",
),
(
"event",
r#"<button data-hemx-handle="save" data-hemx-on="keydown">Save</button>"#,