fix(html-examples): make progress click-driven

Remove interval auto-ticking from the progress example, render visible percentage text next to the native progress element, and update smoke coverage to assert explicit click behavior.

req: htmx_equivalents/001

req: examples/001

req: test/006
This commit is contained in:
slhx agent
2026-06-26 07:47:07 +02:00
parent dc5743de99
commit 379ed02f88
5 changed files with 11 additions and 10 deletions
+5 -4
View File
@@ -179,8 +179,8 @@ impl Hemplate for ProgressMeter {
use std::fmt::Write as _;
write!(
out,
"<progress value=\"{}\" max=\"100\">{}% complete</progress>",
self.percent, self.percent
"<progress value=\"{}\" max=\"100\" aria-label=\"{}% complete\"></progress> <span>{}% complete</span>",
self.percent, self.percent, self.percent
)
.expect("write to String cannot fail");
Ok(())
@@ -815,7 +815,8 @@ mod tests {
assert!(html.contains("data-hemx-form=\"validate_email\""));
assert!(html.contains("data-hemx-revealed=\"true\""));
assert!(html.contains("data-hemx-handle=\"tick_progress\""));
assert!(html.contains("data-hemx-interval=\"1000\""));
assert!(!html.contains("data-hemx-interval=\"1000\""));
assert!(html.contains("0% complete"));
assert!(html.contains("data-hemx-slot=\"loaded_row\""));
assert!(html.contains("data-hemx-slot=\"infinite_row\""));
assert!(html.contains("data-hemx-slot=\"value_option\""));
@@ -921,7 +922,7 @@ mod tests {
.unwrap()
.batch,
);
assert!(progress.payload_contains("<progress value=\"25\" max=\"100\">25% complete</progress>"));
assert!(progress.payload_contains("<span>25% complete</span>"));
let values = inspect_batch(
InteractionRequest::from(form(gallery::choose_category, &[("category", "numbers")]))