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
This commit is contained in:
slhx agent
2026-05-26 01:31:58 +02:00
parent ba3f40a3f0
commit 5972785c3c
10 changed files with 61 additions and 40 deletions
+2 -2
View File
@@ -77,7 +77,7 @@ 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 };
ui::slots::todo_row.append_view(
ui::slots::todo_row.append(
todo.id.to_string(),
&TodoRow { title: todo.title },
)
@@ -121,7 +121,7 @@ mod tests {
fn page_swap_updates_content_and_history() {
fn load_docs() -> impl IntoEffect {
(
ui::slots::content.render_view(&DocsContent {
ui::slots::content.render(&DocsContent {
message: "This page was swapped.",
}),
ui::slots::title.text("Docs"),
+2 -2
View File
@@ -136,7 +136,7 @@ fn registry(state: Arc<ExampleState>) -> HandlerRegistry {
todos.push(Todo { id, title: title.into() });
}
(
ui::todos::slots::todo_list.render_view(&todos_view(&todos)),
ui::todos::slots::todo_list.render(&todos_view(&todos)),
ui::todos::forms::new_todo.clear("title"),
)
}
@@ -163,7 +163,7 @@ fn registry(state: Arc<ExampleState>) -> HandlerRegistry {
.register_handle(ui::page_swap::handles::load_docs, |_| {
// req: page_swap/002, req: examples/001
(
ui::page_swap::slots::content.render_view(&DocsContent {
ui::page_swap::slots::content.render(&DocsContent {
message: "This content came from an EffectBatch.",
}),
ui::page_swap::slots::title.text("Docs"),