feat(editors): expose block_id and action_id behind an Advanced toggle - #172
Conversation
Closes #152. Every block editor now ends with a collapsed "Advanced" disclosure holding the block's `block_id`, and each button form (actions block, section accessory, card actions) gets the same disclosure for its `action_id`. Both were previously reachable only by hand-editing the JSON drawer, even though the builder generates a random id for every button. Native `<details>`, so the open/closed state, the disclosure triangle, and keyboard behavior come from the browser rather than React state. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ion_id 0.1.13 adds the within-a-block duplicate `action_id` check (TightknitAI/slack-block-kit-validator#66). The Advanced fields in this PR let people type ids by hand, so collisions the generated nanoid suffixes made impossible are now one keystroke away, and until this bump nothing flagged them. Test covers both directions: duplicates inside one block are reported and attributed to that block, the same id in two different blocks stays valid (`state.values` is keyed block_id then action_id). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Bumped Confirmed in the demo. Two buttons sharing
New test in Unrelated to this PR but worth knowing: duplicate |
…-toggle-c441e4 # Conflicts: # package.json # pnpm-lock.yaml
Closes #152.
What
Every block editor now ends with a collapsed
▸ Advanceddisclosure holding that block's Block ID. Each button form gets the same disclosure for its Action ID:actions-editor)section-editor)card-editor, also reused per card by the carousel editor)Both ids were previously reachable only by hand-editing the JSON drawer, even though the builder generates a random
action_idfor every button it inserts. Clearing a field drops the key so Slack goes back to generating one.How
One shared
AdvancedIdFieldin field.tsx, built on a native<details>element. No React state, no icon, no new dependency: the disclosure triangle, the toggle, and the keyboard/screen-reader behavior all come from the browser.Block ID lives in block-editor.tsx, the single component every context window renders through, so all 19 block types pick it up at once.
Not included
inputblocks andcontext_actionsblocks already show their elementaction_idas a normal visible field. Left alone rather than hidden behind the new toggle, since they already solve the reported problem and demoting them would be a regression in discoverability.Verification
block_id, editing a buttonaction_id, and clearing back to undefined.approve_requestlands in the exported Block Kit JSON.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.