Add cond-scheme? primitive and parameter binding to tree editor render tab

Register cond-scheme? as OCaml primitive — was defined in spec/evaluator.sx
but never exposed to the browser runtime, causing render.sx to crash with
"Undefined symbol: cond-scheme?" on every SX response. This broke URL
updates on navigation (handle-history never ran after the rendering error).

Tree editor render tab now extracts &key params from defcomp/defisland
definitions and shows input fields. Values substitute into the rendered
preview live as you type. Inputs live outside the reactive cond branch
so signal updates don't steal focus.

sx-tools page function accepts &key params (title, etc.) forwarded to
the overview component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 22:16:08 +00:00
parent 8c99ec4fac
commit 85702e92c9
4 changed files with 44 additions and 681 deletions

View File

@@ -785,6 +785,14 @@ let () =
| [Keyword "else"] -> Bool true
| [Bool true] -> Bool true
| _ -> Bool false);
register "cond-scheme?" (fun args ->
match args with
| [List clauses] ->
Bool (List.for_all (fun c ->
match c with
| List l -> List.length l = 2
| _ -> false) clauses)
| _ -> Bool false);
register "component?" (fun args ->
match args with [Component _] -> Bool true | [Island _] -> Bool true | _ -> Bool false);
register "lambda-closure" (fun args ->