Skip to content

fix: section-only blocks in bodies, list_entries default, long-line per column, body button colour - #121

Merged
Madraka merged 1 commit into
mainfrom
fix/body-blocks-and-tools
Oct 23, 2026
Merged

Madraka merged 1 commit into
mainfrom
fix/body-blocks-and-tools

Conversation

@Madraka

@Madraka Madraka commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

What

More gaps an agent hit building cloudhal.com through the live MCP server (0.3.8 → 0.6.0):

  • Section-only theme blocks in article bodies. A theme block type with where: ["section"] (e.g. link-cards) was accepted in a body ```surface fence by update_entry, then drew "unknown component". `checkBodySurfaces` now refuses it (`invalid_surface` at `/surface//components//component`) through `allowedInBody`: every primitive, every built-in block, and theme blocks whose `where` includes `body`. Unknown names still pass, as before. `get_catalog`'s "In article bodies" lists the blocks a body may use and the page-section-only ones.
  • list_entries default. It defaulted collection to posts, so a site with only blog got []. It now lists every collection. where/orderBy without a collection are refused (invalid_query at collection); before, they were silently ignored.
  • long-line. It divided characters by a rounded line count, so a paragraph's last-line fill decided the verdict, and identical paragraphs in one column disagreed. It now counts characters per rendered line (Range rects, with each paragraph's partial last line left out), pools paragraphs of the same width and font, and gives one verdict and example per column (its width, how many paragraphs).
  • Primary button contrast in bodies (blog starter). .ch-richtext a (0,1,1) beat .ch-button--primary (0,1,0), so a surface Button's text took the link colour on the brand background (2.5:1 light, 1.3:1 dark on cloudhal.com). It is now .ch-richtext a:not(.ch-button).
  • Stale README: already fixed on main (ce822f2: "over 100 tools", the generated reference says 110). No change here.

Tests: core-ts/test/body-surface-blocks.test.ts; mcp-server/test/listings.test.ts (default collection, refusal without one); cli/test/render-chrome-text.test.ts in Chrome. One test has a monospace column where paragraphs with nearly empty and nearly full last lines get one verdict. The other uses the starter's real link rule from tokens.css: the body button passes contrast, and fails with the old selector (checked).

Note for review: with the line count fixed, the blog starter's own column (736 px, 16 px Inter) measures about 92 characters a line, so long-line now flags long paragraphs in starter articles consistently. That is a theme decision (font size or measure) and is not changed here.

Checklist

  • pnpm check passes locally (see below)
  • Contract change? No
  • Changeset added (@cloudhal/core-ts, @cloudhal/mcp-server, @cloudhal/cli patch)
  • Commits are signed off
  • Docs: tool descriptions and the generated MCP README

Verified on a local merge of all three gap PRs (fix/collection-index-page, fix/theme-scripts-csp, fix/body-blocks-and-tools; they merge cleanly): Biome, size check, font-fallback and MCP-doc checks, every typecheck, and every package test suite pass, including @cloudhal/cli (45 files, Chrome render tests included). One exception, not from this change: 35 tests in core-ts store.test.ts on the "Durable Object SQLite (Miniflare)" backend fail with connect EADDRNOTAVAIL (local port exhaustion). main fails the same 35 tests on this machine. No Rust or contract change, so cargo test was not run. GitHub Actions runners do not start (billing), so CI red is environmental.

🤖 Generated with Claude Code

…er column, body button colour

- core-ts: body surfaces refuse theme blocks without where body
  (allowedInBody); catalogPrompt lists what bodies may use.
- mcp-server: list_entries defaults to every collection; where/orderBy
  without a collection are refused instead of ignored.
- render_page long-line counts rendered lines and pools paragraphs of
  one column, so identical paragraphs agree.
- blog starter: .ch-richtext links no longer recolour .ch-button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Madraka <[email protected]>
@Madraka
Madraka merged commit 36536c8 into main Oct 23, 2026
5 checks passed
@Madraka
Madraka deleted the fix/body-blocks-and-tools branch October 23, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant