Phase 5 cleanup: remove legacy HTML components, fix nav-tree fragment

- Remove old raw! layout components (~app-head, ~app-layout, ~oob-response,
  ~header-row, ~menu-row, ~oob-header, ~header-child) from layout.sexp
- Convert nav-tree fragment from Jinja HTML to sexp source, fixing the
  "Unexpected character: ." parse error caused by HTML leaking into sexp
- Add _as_sexp() helper to safely coerce HTML fragments to ~rich-text
- Fix federation/sexp/search.sexpr extra closing paren
- Remove dead _html() wrappers from blog and account sexp_components
- Remove stale render import from cart sexp_components
- Add dev_watcher.py to auto-reload on .sexp/.sexpr/.js/.css changes
- Add test_parse_all.py to parse-check all 59 sexpr/sexp files
- Fix test assertions for sx- attribute prefix (was hx-)
- Add sexp.js version logging for cache debugging

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 10:12:03 +00:00
parent 22802bd36b
commit a643b3532d
21 changed files with 225 additions and 232 deletions

View File

@@ -387,10 +387,6 @@ def _page_card_sexp(page: dict, ctx: dict) -> str:
excerpt=excerpt,
)
def _page_card_html(page: dict, ctx: dict) -> str:
"""Single page card (HTML, kept for backwards compat)."""
return _page_card_sexp(page, ctx)
def _view_toggle_sexp(ctx: dict) -> str:
"""View toggle bar (list/tile) for desktop."""
@@ -547,10 +543,6 @@ def _action_buttons_sexp(ctx: dict) -> str:
inner=SexpExpr(inner) if inner else None,
)
def _action_buttons_html(ctx: dict) -> str:
"""New Post/Page + Drafts toggle buttons (HTML, kept for backwards compat)."""
return _action_buttons_sexp(ctx)
def _tag_groups_filter_sexp(ctx: dict) -> str:
"""Tag group filter bar as sexp."""
@@ -591,10 +583,6 @@ def _tag_groups_filter_sexp(ctx: dict) -> str:
items = "(<> " + " ".join(li_parts) + ")"
return sexp_call("blog-filter-nav", items=SexpExpr(items))
def _tag_groups_filter_html(ctx: dict) -> str:
"""Tag group filter bar (HTML, kept for backwards compat)."""
return _tag_groups_filter_sexp(ctx)
def _authors_filter_sexp(ctx: dict) -> str:
"""Author filter bar as sexp."""
@@ -628,10 +616,6 @@ def _authors_filter_sexp(ctx: dict) -> str:
items = "(<> " + " ".join(li_parts) + ")"
return sexp_call("blog-filter-nav", items=SexpExpr(items))
def _authors_filter_html(ctx: dict) -> str:
"""Author filter bar (HTML, kept for backwards compat)."""
return _authors_filter_sexp(ctx)
def _tag_groups_filter_summary_sexp(ctx: dict) -> str:
"""Mobile filter summary for tag groups (sexp)."""
@@ -649,9 +633,6 @@ def _tag_groups_filter_summary_sexp(ctx: dict) -> str:
return ""
return sexp_call("blog-filter-summary", text=", ".join(names))
def _tag_groups_filter_summary_html(ctx: dict) -> str:
"""Mobile filter summary for tag groups (HTML, kept for backwards compat)."""
return _tag_groups_filter_summary_sexp(ctx)
def _authors_filter_summary_sexp(ctx: dict) -> str:
@@ -670,9 +651,6 @@ def _authors_filter_summary_sexp(ctx: dict) -> str:
return ""
return sexp_call("blog-filter-summary", text=", ".join(names))
def _authors_filter_summary_html(ctx: dict) -> str:
"""Mobile filter summary for authors (HTML, kept for backwards compat)."""
return _authors_filter_summary_sexp(ctx)
# ---------------------------------------------------------------------------