Spec explorer: fix SxExpr rendering bugs, add drill-in UX, Playwright tests

Fix 3 OCaml bugs that caused spec explorer to hang:
- sx_types: inspect outputs quoted string for SxExpr (not bare symbol)
- sx_primitives: serialize/to_string extract SxExpr/RawHTML content
- sx_render: handle SxExpr in both render-to-html paths

Restructure spec explorer for performance:
- Lightweight overview: name + kind only (was full source for 141 defs)
- Drill-in detail: click definition → params, effects, signature
- explore() page function accepts optional second arg for drill-in
- spec() passes through non-string slugs from nested routing

Fix aser map result wrapping:
- aser-special map now wraps results in fragment (<> ...) via aser-fragment
- Prevents ((div ...) (div ...)) nested lists that caused client "Not callable"

5 Playwright tests: overview load, no errors, SPA nav, drill-in detail+params

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-01 23:46:13 +00:00
parent b3718c06d0
commit 6e885f49b6
9 changed files with 447 additions and 217 deletions

View File

@@ -213,10 +213,12 @@
spec
(fn
(slug)
(if
(cond
(nil? slug)
(quote (~specs/architecture-content))
(case
(not (= (type-of slug) "string"))
slug
:else (case
slug
"core"
(let
@@ -278,22 +280,34 @@
(define
explore
(fn
(slug)
(slug defname)
(if
(nil? slug)
(quote (~specs/architecture-content))
(let
((found-spec (find-spec slug)))
(if
found-spec
(let
((data (spec-explore (get found-spec "filename") (get found-spec "title") (get found-spec "desc"))))
(if
data
(quasiquote
(~specs-explorer/spec-explorer-content :data (unquote data)))
(quasiquote (~specs/not-found :slug (unquote slug)))))
(quasiquote (~specs/not-found :slug (unquote slug))))))))
(not found-spec)
(quasiquote (~specs/not-found :slug (unquote slug)))
(if
defname
(let
((d (spec-explore-define (get found-spec "filename") defname)))
(if
d
(quasiquote
(~specs-explorer/spec-explorer-define-detail
:d (unquote d)
:filename (unquote (get found-spec "filename"))))
(quasiquote
(~specs/not-found :slug (unquote (str slug "." defname))))))
(let
((data (spec-explore (get found-spec "filename") (get found-spec "title") (get found-spec "desc"))))
(if
data
(quasiquote
(~specs-explorer/spec-explorer-content :data (unquote data)))
(quasiquote (~specs/not-found :slug (unquote slug)))))))))))
(define
make-spec-files