feat(editors): let image blocks switch between URL and Slack file sources - #192
Merged
StephenTangCook merged 1 commit intoAug 17, 2026
Merged
Conversation
…rces A slack_file-backed image block used to render a single "not editable" message in the editor flyout, with no way out — you couldn't convert it to the image_url variant the builder does support. Add an "Image source" radio (Public URL / Slack file) that swaps one backing field for the other (Slack rejects a block carrying both), plus editable File ID / File URL fields for the slack_file reference itself. Alt text and title now stay editable in both variants. Switching to Public URL starts from an empty image_url on purpose: the flyout's validation error nudges the user to paste a real URL instead of silently sending a placeholder. The new story overrides the meta useArgs render because updateArgs deep-merges args — a merge can't express removing the slack_file key. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EWnoaAY6K3zJVW16TtduX3
StephenTangCook
deleted the
claude/image-block-slack-file-control-vp9egt
branch
August 17, 2026 14:45
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
Adds an "Image source" radio (Public URL / Slack file) to the image block editor flyout, so a
slack_file-backed image block can be converted to theimage_urlvariant (and back), instead of rendering as a dead-end "not editable" message. Theslack_filereference itself (File ID / File URL) plus alt text and title are now editable in both variants.Why
The builder doesn't support
slack_file(no upload flow, and the preview can't render workspace files), so an image block loaded from an existing message with aslack_filebacking was completely stuck — the flyout showed "Not editable in the visual builder" with no way to switch it to a URL-backed image.Implementation notes:
image_urlandslack_file(verified against@tightknitai/slack-block-kit-validator), so the source switch swaps one backing field for the other. The replaced default is spread first so a malformed block that already carries both keys keeps its existing value.image_url: the flyout's validation error nudges the user to paste a real URL rather than silently sending a placeholder image.slack_file, Slack accepts{id}or{url}(not both), so editing one field rewrites the reference and clears the other.SwitchingImageSourceProducesValidBlockstory overrides the metauseArgsrender with local state:updateArgsdeep-merges args, and a merge can't express removing theslack_filekey.Test plan
pnpm typecheckpnpm lintpnpm test— 513 passed (44 files), including 8 new unit tests intest/image-editor.test.tsxand 2 new stories (a staticslack_fileeditor story and a browser play test convertingslack_file→ URL end-to-end)pnpm buildandpnpm build-storybookGenerated by Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.