feat(editing): pre-load a message into edit mode via editing.initialTarget#136
Merged
Conversation
…arget Add an optional `editing.initialTarget` prop (the `ok: true` branch of `LoadResult`) that boots BlockKitchen straight into edit mode at mount, skipping the load dialog. Its `blocks` seed the draft and win over `initialBlocks`; when both are given we warn and ignore `initialBlocks`. Read once at mount, like `initialBlocks`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
block-kitchen | a7ed7e8 | Commit Preview URL Branch Preview URL |
Jul 01 2026, 11:09 PM |
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.
What
Adds an optional
editing.initialTargetprop so a host can bootBlockKitchenstraight into edit mode at mount, skipping the load dialog.Answers the question "can block-kitchen take a pre-loaded Slack message and open in edit mode?" — previously
initialBlocksonly seeded a blank-canvas draft (no channel/ts lock, no update path); the only way into true edit mode was the user pasting a permalink or picking a recent message.API
initialTargetreuses theok: truebranch of the existingLoadResult— the same shape the host already returns fromonLoadMessageon success — so there's no new type to learn:Usage:
Behavior
initialBlocks(changing it later needs a remount).blocksseed the draft and win overinitialBlocks(the blank-canvas seed).initialBlocksandediting.initialTargetare given, weconsole.warnand ignoreinitialBlocksrather than merging or throwing.Tests
New
test/block-kitchen-initial-target.test.tsx:initialTargetis setinitialBlocksis also providedFull suite green (373 tests), typecheck + biome clean.
🤖 Generated with Claude Code