feat(build): generate keyed view commands

Add lower-aware generated append/prepend/replace helpers for keyed slots, move the v0 keyed todo example off the facade extension trait, and keep beginner examples from importing lower-level render shortcuts.

req: dx/006

req: codegen/002

req: public_api/003

req: examples/003
This commit is contained in:
slhx agent
2026-06-02 03:05:37 +02:00
parent 15809c86a6
commit ee6045aec5
5 changed files with 40 additions and 11 deletions
+3 -2
View File
@@ -5,7 +5,7 @@ pub mod ui {}
mod tests {
use super::ui::{auth, counter, notifications, page_swap, todos, wizard};
use hemplate::Hemplate;
use slhx::{push, Effect, IntoEffect, NavigateMode, Payload, RenderKeyedSlotExt};
use slhx::{push, Effect, IntoEffect, NavigateMode, Payload};
use slhx_test::inspect;
#[derive(Clone, Debug)]
@@ -77,7 +77,8 @@ mod tests {
fn todos_append_keyed_rows_from_form_input() {
fn add_todo(input: TodoInput) -> impl IntoEffect {
let todo = Todo { id: 7, title: input.title };
todos::slots::todo_row.append(
todos::append(
todos::slots::todo_row,
todo.id.to_string(),
&TodoRow { title: todo.title },
)