Commit Graph

368 Commits

Author SHA1 Message Date
slhx agent efd4e2f369 fix(build): validate slhx convention placement
Reject data-slhx-nav on non-anchor elements and data-slhx-sse away from its root, so standard conventions keep progressive navigation and root-scoped push semantics instead of silently doing nothing.

req: page_swap/001

req: push/006

req: diagnostics/002
2026-06-01 21:13:04 +02:00
slhx agent 56f4db88c4 fix(js): keep standard sse same-origin
Require non-empty data-slhx-sse values at build time and have the standard runtime reject cross-origin EventSource URLs with slhx:sse-error instead of opening an implicit external stream.

req: push/006

req: diagnostics/002
2026-06-01 21:07:14 +02:00
slhx agent 0315044f53 fix(build): reject empty slhx guards
Treat empty static data-slhx-on lists and empty data-slhx-confirm messages as build errors, so authors do not silently disable dispatch or confirmation guards with blank attributes.

req: convention/002

req: convention/004

req: diagnostics/002
2026-06-01 21:01:29 +02:00
slhx agent b98820e819 fix(build): reject unsupported slhx events
Validate static data-slhx-on values against the runtime-supported delegated event set so generated EventName constants cannot imply browser behavior the runtime will never dispatch.

req: convention/002

req: diagnostics/002
2026-06-01 20:48:18 +02:00
slhx agent 44366252f7 fix(build): validate slhx convention values
Reject invalid static data-slhx-policy and timing convention values at build time, so typos fail with author-facing guidance instead of silently falling back or disabling runtime behavior.

req: convention/003

req: convention/005

req: convention/006

req: diagnostics/002
2026-06-01 20:42:39 +02:00
slhx agent cd54dd5cf0 fix(build): reject unknown slhx attributes
Fail fast when templates use misspelled or unsupported data-slhx-* attributes, with guidance to fix the spelling or use non-slhx data-* metadata for app-specific islands.

req: convention/009

req: diagnostics/002
2026-06-01 20:37:54 +02:00
slhx agent 3c4c802731 fix(build): reject slhx selector targeting
Fail fast when templates invent selector-style data-slhx-target or data-slhx-select attributes, and point authors back to generated local slots instead of runtime selector semantics.

req: locality/001

req: locality/002

req: htmx_equivalents/003
2026-06-01 20:33:33 +02:00
slhx agent e5f332e78a fix(js): clear interval handles when polling stops
Keep data-slhx-every timers separate from debounce/throttle timers and delete the interval handle when a polling element leaves the document, so reinserted elements can start polling again without leaking stale timer state.

req: convention/005
2026-06-01 20:28:11 +02:00
slhx agent 4295e93da7 fix(js): release parallel pending state
When data-slhx-policy=parallel runs overlapping requests against one target, release pending UI bookkeeping for each completed request instead of only the last pending handle.

req: convention/006

req: convention/007

req: convention/008
2026-06-01 20:24:43 +02:00
slhx agent e6486c1b35 fix(js): release superseded latest pending state
When data-slhx-policy=latest aborts an in-flight request, release that request's pending UI bookkeeping before starting the replacement request so pending classes, indicators, and disabled controls do not leak.

req: convention/006

req: convention/007
2026-06-01 20:20:26 +02:00
slhx agent 31b812f557 fix(js): preserve pending indicator state
Track pending class and indicator state with small reference counts so overlapping requests do not hide indicators early or strip a class that existed before the request.

req: convention/007

req: convention/008
2026-06-01 20:16:19 +02:00
slhx agent 8e39d6c4ac fix(js): restore disabled controls after pending
Remember each control's pre-request disabled state and keep a small pending count so data-slhx-disable-while-pending does not accidentally enable controls that were disabled before the request.

req: convention/007
2026-06-01 20:12:29 +02:00
slhx agent 28d1856dd7 fix(js): reload stale popstate partials
When back/forward navigation receives an incompatible or unusable partial response, reload the current URL instead of leaving the previous UI stale.

req: page_swap/005

req: page_swap/006

req: runtime/004
2026-06-01 20:08:17 +02:00
slhx agent 8d1bdaec08 fix(js): keep form-owner lookup root scoped
Resolve controls with a form= attribute inside the current slhx root instead of using document-global id lookup, preserving multi-root isolation for direct handle dispatch.

req: runtime/001

req: convention/004
2026-06-01 20:02:05 +02:00
slhx agent d732c921c2 fix(techdemo): rebootstrap inserted islands
Keep opaque island widgets live when slhx swaps or later DOM insertion adds a new island, and tear down the listener when an island leaves the document.

req: interop/001

req: examples/001
2026-06-01 19:57:39 +02:00
slhx agent 9d3f70e9fe feat(techdemo): add opaque island bridge
Add a canvas leaf-widget island to the techdemo that receives server snapshots through Effect::event/CustomEvent while keeping slhx core and runtime semantics unchanged.

req: interop/001

req: examples/001

req: examples/005
2026-05-26 07:29:51 +02:00
slhx agent 28ee1b5111 docs(agents): note hemplate syntax gotchas 2026-05-26 07:15:27 +02:00
slhx agent 625f797ff1 docs(requirements): align surface build contract
Clarify that slhx consumes hemplate Surface facts and may request in-process hemplate extraction for simple build scripts, without owning .heml parsing semantics.

req: surface/001

req: surface/008

req: build/001

req: boundary/003
2026-05-26 01:42:22 +02:00
slhx agent 162c117a5a test(v0): use component-scoped generated APIs
Drop the v0 example's global export opt-in and update tests to use component-scoped slots and forms, matching the checked public API path.

req: component/003

req: build/001
2026-05-26 01:38:01 +02:00
slhx agent e20d356c1d docs(examples): mark page shell html boundaries
Document that remaining SafeHtml use in examples is limited to full-page shell composition of already-rendered hemplate fragments, while effect payloads use render helpers.

req: html_safety/002

req: view/001
2026-05-26 01:34:05 +02:00
slhx agent 5972785c3c feat(slhx): prefer render methods for views
Move view rendering onto Slot::render and KeyedSlot append/prepend/replace extension methods, leaving explicit text/html methods for non-view escape hatches.

req: codegen/002

req: view/001
2026-05-26 01:31:58 +02:00
slhx agent ba3f40a3f0 feat(build): emit checked param tokens
Generate ParamName constants for handle data parameters so public code can refer to checked param metadata instead of stringly typed names.

req: codegen/003
2026-05-26 01:28:51 +02:00
slhx agent 280464017b feat(build): accept precomputed surface facts
Allow slhx-build callers to feed hemplate SurfaceDocument facts directly, preserving the existing .heml parse fallback while covering the build-from-surface path.

req: surface/008

req: build/001
2026-05-26 01:24:03 +02:00
slhx agent d3fc1a745a fix(js): remove runtime selector traversal
Replace runtime querySelector/closest/matches traversal with explicit element walks and generated-id predicates, preserving existing runtime convention coverage.

req: runtime/001

req: target_policy/001

req: target_policy/002
2026-05-26 01:18:21 +02:00
slhx agent a8bd7dfdf7 test(examples): use shared slhx render helper
Remove remaining example-local render_html wrappers in favor of slhx::render_html so public examples share the hemplate render_into effect boundary.

req: view/001

req: html_safety/002
2026-05-26 01:10:57 +02:00
slhx agent 3d65e92783 test(kanban): render lib slot from view helper
Use RenderSlotExt in the kanban library smoke test so even the small public example test path avoids explicit SafeHtml/html plumbing.

req: view/001

req: html_safety/002
2026-05-26 01:07:06 +02:00
slhx agent 5845930cd3 test(techdemo): render slots from hemplate views
Migrate techdemo effect paths and tests from explicit SafeHtml/html payload plumbing to RenderSlotExt view helpers.

req: view/001

req: html_safety/002
2026-05-26 01:03:58 +02:00
slhx agent 852053fd04 test(v0): render slots from hemplate views
Migrate v0 handlers and tests from explicit SafeHtml/html payload plumbing to RenderSlotExt and RenderKeyedSlotExt view helpers.

req: view/001

req: html_safety/002
2026-05-26 00:58:29 +02:00
slhx agent b6ecb9513c feat(slhx): render hemplate views into slots
Add render_html plus slot render_view helpers that call hemplate render_into, and migrate a kanban effect path from explicit SafeHtml/html handling to the renderable-view helper.

req: view/001

req: html_safety/002
2026-05-26 00:53:43 +02:00
slhx agent 62316d5f1e test(examples): render hemplate views into buffers
Use hemplate render_into in public examples and example tests instead of the string-returning render helper, preserving SafeHtml wrapping only at the explicit effect boundary.

req: view/001

req: html_safety/002
2026-05-26 00:46:13 +02:00
slhx agent b2aa1760c5 feat(axum): build forms from checked handles
Add InteractionForm::for_handle so tests and public integration code can construct dispatched forms from generated Handle<T> values instead of raw numeric handle ids.

req: ceremony/004

req: public_api/001
2026-05-26 00:42:39 +02:00
slhx agent 062c184e42 feat(core): format generated resources for templates
Implement Display for generated slots, keyed slots, atoms, and forms so public examples can pass typed resources directly to hemplate dynamic attributes and tests instead of extracting raw numeric ids.

req: public_api/001

req: public_api/002
2026-05-26 00:39:47 +02:00
slhx agent efabd3ff66 feat(build): emit checked component refs
Generate ComponentRef constants for component-scoped APIs, include global component refs only when global_exports(true) is enabled, and document/use the checked component token.

req: component/003
2026-05-26 00:35:59 +02:00
slhx agent a421865852 feat(core): format handles for templates
Implement Display for generated Handle<T> values and migrate example view data to carry handles directly instead of raw handle id numbers for dynamic handle attributes.

req: public_api/001

req: public_api/002
2026-05-26 00:30:23 +02:00
slhx agent bc8534a768 feat(axum): register checked handles
Add HandlerRegistry::register_handle for generated Handle<T> values and migrate examples away from passing raw numeric handle ids at registration sites.

req: ceremony/004

req: public_api/001
2026-05-26 00:26:42 +02:00
slhx agent 4803d681d2 feat(build): make global exports opt in
Default generated APIs to component-scoped modules and require global_exports(true) for legacy/global slot, handle, class, event, and lowering exports.

req: component/003

req: build/001
2026-05-26 00:23:38 +02:00
slhx agent 93c68b6d87 feat(derive): scope component handler checks
Allow #[slhx::component("name")] to validate only the generated handles for that hemplate component, so component modules can be checked independently without implementing unrelated handles.

req: component/003

req: component/005
2026-05-26 00:18:17 +02:00
slhx agent 814be5922a fix(core): type slot render payloads
Tighten typed Slot::render and KeyedSlot append/prepend/replace helpers so callers pass the generated slot payload type, keeping explicit html/text escape hatches for deliberate conversions.

req: codegen/002

req: typed_id/001
2026-05-26 00:12:45 +02:00
slhx agent 5364135c5e feat(build): type generated event constants
Generate EventName constants for data-slhx-on metadata and exercise them through typed event emission in techdemo.

req: codegen/006
2026-05-26 00:09:07 +02:00
slhx agent 0b6ad64d98 feat(derive): expose checked form resource constants
Have #[slhx::form] emit an associated FORM resource so checked form handlers can be called with TodoInput::FORM-style values instead of generated_resource.typed::<T>() noise.

req: form/001

req: form/004

req: form/006

req: codegen/004
2026-05-26 00:03:47 +02:00
slhx agent 1b255e593d test(v0): check auth and wizard form handlers
Annotate the v0 auth and wizard form models with #[slhx::form], make their templates expose checked form fields, and add handler smoke tests over the generated form resources.

req: form/001

req: form/004

req: form/006

req: derive_handler/003
2026-05-25 23:59:24 +02:00
slhx agent d67478fe36 test(techdemo): exercise checked form handler path
Add techdemo coverage for #[slhx::form] plus #[slhx::handler] on the generated launch_work form, and ignore the internal __h hidden handle field in generated form metadata.

req: form/001

req: form/004

req: form/006

req: derive_handler/003
2026-05-25 23:57:08 +02:00
slhx agent 54aecff6e8 test(kanban): exercise checked form handler path
Add a kanban example smoke test for #[slhx::form] plus #[slhx::handler] over the generated create_card form resource.

req: form/001

req: form/004

req: form/006

req: derive_handler/003
2026-05-25 23:54:09 +02:00
slhx agent 11f710d276 test(v0): exercise checked form handler path
Use #[slhx::form] in the v0 example tests and add a checked form-handler smoke test, with a typed() helper for generated form ids so examples do not rebuild ids by hand.

req: form/001

req: form/004

req: form/006

req: derive_handler/003
2026-05-25 23:52:10 +02:00
slhx agent 21716882ab feat(derive): check form parser availability
Introduce FormValue as the parser-availability bound for #[slhx::form] models, blanket it for FromStr types, and add compile-fail coverage for a form field whose domain type lacks a parser.

req: form/004

req: form/006
2026-05-25 23:48:56 +02:00
slhx agent 274b8e9e55 feat(derive): check form model structure
Add #[slhx::form] for user-authored form models, emit form field metadata into slhx.syms, and require form handlers to accept models that passed generated field compatibility checks.

req: form/001

req: form/004

req: form/006

req: codegen/004
2026-05-25 23:44:43 +02:00
slhx agent 34d6757ccd fix(derive): reject form impostor parameters
Tighten generated-form handler checking so a parameter must look like slhx::Form<T> or imported Form<T>, not a nongeneric local Form or unrelated path with a Form suffix.

req: form/004

req: form/006
2026-05-25 23:31:48 +02:00
slhx agent d02c15c59b test(derive): keep form handlers checked for params
Add compile-fail coverage showing that accepting a generated Form<T> does not bypass required generated data-param checking for the same handle.

req: form/006

req: derive_handler/003
2026-05-25 23:29:06 +02:00
slhx agent c1fb5e986a test(build): cover form contract metadata
Assert that slhx-build lowers Surface form controls into generated FormContract field metadata, including names, control kinds, required flags, and handle-to-form syms.

req: codegen/004

req: form/001
2026-05-25 23:27:16 +02:00
slhx agent 4d4f5cd2bc test(examples): assert escaped text exactly
Make v0 and kanban DOM-aware escaped-text checks exact instead of substring-based while preserving the no-rendered-tag assertions.

req: html_safety/002

req: test/005
2026-05-25 23:23:14 +02:00