Skip to content

fix: drop preview_images from data_visualization blocks on retrieval#144

Merged
StephenTangCook merged 1 commit into
mainfrom
claude/data-viz-preview-images-jj5aaz
Jul 2, 2026
Merged

fix: drop preview_images from data_visualization blocks on retrieval#144
StephenTangCook merged 1 commit into
mainfrom
claude/data-viz-preview-images-jj5aaz

Conversation

@StephenTangCook

Copy link
Copy Markdown
Contributor

Summary

Slack attaches preview_images to data_visualization blocks when retrieving them, but the API rejects these fields when sending the blocks back. This change adds preview_images to the retrieval-only keys that are stripped during sanitization for data_visualization blocks.

Why

When retrieving blocks containing data_visualization elements, Slack includes server-rendered chart previews in a preview_images field. However, when these blocks are sent back to Slack (e.g., via block updates), the API rejects preview_images as an unknown property. The sanitizer needs to remove this field specifically from data_visualization blocks while preserving it on other block types that may legitimately use it.

Test plan

  • Added two new test cases covering the behavior:
    • Verifies preview_images is dropped from data_visualization blocks
    • Verifies preview_images is preserved on other block types (e.g., section)
  • Existing tests continue to pass

https://claude.ai/code/session_014aydKTubf32kAFUbnCNLRb

…tion

Slack renders data_visualization charts server-side and attaches
`preview_images` on retrieval, but rejects that field on send with
`unknown property 'preview_images'`. Add it to RETRIEVAL_ONLY_KEYS so
round-tripped charts stay send-valid.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aydKTubf32kAFUbnCNLRb
@StephenTangCook StephenTangCook merged commit 8706a80 into main Jul 2, 2026
11 checks passed
@StephenTangCook StephenTangCook deleted the claude/data-viz-preview-images-jj5aaz branch July 2, 2026 16:24
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.

2 participants