Repository navigation
Conversation
Fenced ```zeron-visual blocks in Markdown documents run as Luau visuals in the Files preview, with a Show source / Show visual toggle, a cap of 8 live visuals per document, and a Run visual button for documents outside the workspace. Add `zeron visual check <file>`, which runs a document's fences (or a .luau script) with the preview's seeds and maps errors to document lines, backed by a line scanner in zeron_visual::document.
jsgrrchg
marked this pull request as draft
October 15, 2026 04:39
Contributor
Author
|
The Only one test failed (464/465 passed), on the Windows runner:
The test enqueues a chat update and acknowledges it right after nudging the remote host. My guess (not verified) is that on a slow runner the host sometimes delivers that update to the mock server before the ack lands, which trips both assertions. If so, it's a timing race in the test rather than a product bug. I'll re-run the failed job; if it fails again I'll open a separate issue for it. |
jsgrrchg
marked this pull request as ready for review
October 15, 2026 04:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agents (and people) can now embed native Zeron visuals directly in a Markdown document. A fenced block whose language is
zeron-visualruns as a Luau visual in the Files Markdown preview, with the same runtime, theme tokens and controls asshow_visualin chat.Elsewhere (GitHub, other editors, chat replies, iOS) the fence is ordinary code, so documents stay portable.
What changed
markdown_preview.rs,render.rs,visuals.rs): fences render without a code-block frame, with a quiet "Show source / Show visual" toggle. A document runs at most 8 visuals, each starting lazily when its row first renders. Truncated previews run none, and documents outside the workspace show a "Run visual" button instead of running on their own.math.randomis seeded from the fence's code and its position among identical fences (seed_for_document), so a fence keeps its data and live state when surrounding text changes.zeron visual check <file>: runs every fence of a.md/.markdown(or a whole.luau) the way the preview will and maps errors to document lines, so an agent that cannot see the preview can still validate its work. Exits 1 on any failure.crates/markdown):fenced_code_blocks()reusesparse_full's parser, options and normalization, so the CLI and the preview always agree on what a fence is (and therefore on seeds).docs/mcp.mddocuments the feature; theshow_visualtool description mentions fences andvisual check.Fixes found while building this
visit_blocks) shared by rendering and the fence helpers. This also fixes the same collision for code-block scroll handles.sync_visualsnow retains only allowed visuals.Performance
Measured on Linux, release build, RTX 3090, comparing this branch against its base:
render_code_block);sync_visualsandrow_visualscost about 0.1 ms and 0.7 ms upper bound for a 6000-block document.Known limitations
s:model, textures, asset environments fail with the runtime's usual error).Test plan
cargo test -p zeron-visual -p zeron-markdownandcargo test -p zeron-ui --lib markdowncargo test -p zeron --bin zeron visual_cli.mdwith severalzeron-visualfences in Files > Preview: they render, toggle source, and keep state while editing text around themzeron visual check doc.mdreports a deliberate error at the right document lineNeed help on this PR? Tag
@codesmith-botwith what you need.