Issue 593
enhancement: Agents can draft the visual blocks (Markdown converters for timeline, steps, key facts, outcome fork, diagram key)
Back to our planOpen
enhancementcmstoolingpriority: medium
Problem
In plain words: agents write their drafts in Markdown, and the site turns that into the editor's rich text. Today the visual blocks (timeline, steps, key facts, outcome fork, diagram key) can't be written in Markdown, so every agent draft arrives as plain text. An editor then rebuilds the visuals by hand. The owner wants every post to come with visuals.
Summary of the owner's request (2026-11-02, Claude conversation, text): a post should be more than text; each one is analyzed first, and then intuitive visuals are produced for it.
Today (checked):
- How drafts arrive.
submitSuggestion(src/modules/agents/cms/tools/submitSuggestion.ts) convertsbodyMarkdownwith Payload'sconvertMarkdownToLexical. - No converters. None of the editorial block configs in
src/platform/richtext/editorial/defines ajsxproperty. - Payload supports it. Payload v3 converts custom blocks to and from Markdown (MDX-style tags) through the block's
jsxproperty, withimportandexportfunctions (Payload docs, "Converting Markdown").
Proposed fix
- Converters. Add
jsx.importandjsx.exportto Timeline, Steps, Key facts, Outcome fork and Diagram key. Props carry the simple fields. Children carry the rich text, through the helpers Payload passes. - Validation. Unknown tags and invalid props are refused by the block's own field validation.
submitSuggestionreturns the error to the agent. It never stores a broken block. - Agent context. Document the tags in one short reference the agents get (
intelligence/prompts/draft.md), with one example per block. - Size caps. Rows per block and length per field stay within the existing caps on tool arguments (#336).
- Watch out: this touches
src/platform/richtext/.
Native first, one line per step:
- Native: the block
jsxproperty andconvertMarkdownToLexical, both already used. - Official plugins: none needed.
- Open source: none needed.
- Our code: five small converter pairs and their round-trip tests.
Acceptance criteria
- Not done: Each of the five blocks round-trips Markdown → block → Markdown in a test.
- Not done:
payload.config.agentTools.test.tsstores a suggestion whose Markdown holds a Key facts block and a Timeline, and refuses one with a malformed block, with a clear error. - Not done:
draft.mdlists the tags. The draft evals include one case per block.
Area
cms, tooling
Priority
medium
Generated by Claude Code, opens in a new tab