feat: support content chunk updates with dot notation and fix richTex… - #18
Conversation
…t mutations - Add nested component updates via dot notation (e.g. image-and-title.title), - Round-trip sibling preservation with contentToInput, - Fix richText mutations to use json format instead of invalid plainText field.
There was a problem hiding this comment.
Pull request overview
This PR extends the content mutation tooling to support updating nested components inside contentChunk components using dot notation, improves mutation round-tripping to preserve sibling fields, and fixes rich text mutations to use a JSON payload instead of an invalid plainText input.
Changes:
- Add dot-notation support for updating
contentChunkchild components (e.g.hero.title) inupdate_component. - Introduce
contentToInputto rebuild mutation inputs from existing content to better preserve siblings during updates. - Update rich text mutation input to use
richText.jsoninstead ofrichText.plainText, and expand docs/tests accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/tools/content.ts |
Implements dot-notation parsing, chunk-child updates, sibling round-tripping, and richText JSON mutations. |
tests/content.test.ts |
Updates dry-run stubs and adds coverage for dot-notation updates and invalid chunk child errors. |
README.md |
Documents write tools, dry-run mode, and content tools; updates the tool count. |
Comments suppressed due to low confidence (1)
src/tools/content.ts:633
- The dry-run preview string still says
Mutation: item.updateComponent(...), but the actual mutation executed below isupdateComponent(...)(root field) vianextPimApi. Update the preview text to match the real mutation shape so users aren’t misled when reviewing dry-run output/audit logs.
`Current value: ${currentValue}`,
`New value: ${JSON.stringify(value)}`,
'',
`Mutation: item.updateComponent(itemId: "${itemId}", language: "${language}", component: ${JSON.stringify(componentInput)})`,
'',
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
src/tools/content.ts:658
- Dry-run preview still prints
item.updateComponent(...), but the actual mutation executed below isupdateComponent(...)(top-level). This makes the preview misleading; align the dry-run “Mutation:” line with the real mutation shape (or update the mutation if the nested form is the correct API).
`Current value: ${currentValue}`,
`New value: ${JSON.stringify(value)}`,
'',
`Mutation: item.updateComponent(itemId: "${itemId}", language: "${language}", component: ${JSON.stringify(componentInput)})`,
'',
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- get_shape: fix GraphQL inline fragments (repeatable vs repeating, proper type spreads) - get_item: add ContentChunkContent fragment so chunk rows are returned - update_component: add rowIndex param to target specific rows in repeating chunks; fix critical bug where only the target row was sent back in the mutation, wiping all other rows (shadowed const allRows inside try block)
* 'main' of github.com:HayoDev/crystallize-mcp: chore(main): release crystallize-mcp 0.2.0 (#24) feat!: setup-wizard :nail-care: (#23) chore(main): release crystallize-mcp 0.1.10 (#22) fix: improve setup wizard and docs (#21) chore(main): release crystallize-mcp 0.1.9 (#20) feat: support content chunk updates with dot notation and fix richTex… (#18)
* main: chore(main): release crystallize-mcp 0.2.0 (#24) feat!: setup-wizard :nail-care: (#23) chore(main): release crystallize-mcp 0.1.10 (#22) fix: improve setup wizard and docs (#21) chore(main): release crystallize-mcp 0.1.9 (#20) feat: support content chunk updates with dot notation and fix richTex… (#18)
…t mutations