Conversation
…ory functions Zero-dependency package providing plain factory functions that eliminate Block Kit JSON boilerplate. Covers text helpers, composition objects, blocks, interactive elements, input elements, selects, rich text, tables, and surface builders (modal/homeTab).
Dogfood @botarium/block-kit in the showcase bot: - Add block-kit-messages.ts with all 16 messages as block-kit function calls - Add `/showcase block-kit` subcommand (parallel to `/showcase generate`) - Replace 215 lines of raw modal JSON with ~15 lines of block-kit calls - Split block-kit View type into ModalView/HomeTabView for Slack type compat
|
No actionable comments were generated in the recent review. 🎉 📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a new Changes
Sequence DiagramsequenceDiagram
actor User as User
participant Slack as Slack
participant App as Showcase App
participant Channel as "#showcase"
User->>Slack: /showcase block-kit
Slack->>App: invoke command handler
App->>App: sendBlockKitMessages(client)
App->>Channel: clear channel (delete previous messages)
loop for each blockKitMessage
App->>Channel: chat.postMessage(blockKitMessage)
Channel-->>App: post result / error
App->>App: log per-message result
end
App->>App: log summary
App->>Slack: acknowledge command
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/showcase-bot/src/listeners/commands/showcase.ts (1)
74-99: Consider extracting a shared send helper to reduce duplication.
sendShowcaseMessagesandsendBlockKitMessagesonly differ by message source and log labels, so a small helper would keep the logic DRY and prevent drift.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/showcase-bot/src/listeners/commands/showcase.ts` around lines 74 - 99, Extract a shared helper (e.g., sendMessages or postMessagesToShowcase) that takes (client, messages, successLogLabel, failureLogLabel) or similar and moves the loop, try/catch, client.chat.postMessage call, error logging (slackLogger.error) and final info logging (slackLogger.info) into it; then refactor sendShowcaseMessages and sendBlockKitMessages to call this helper with their respective message arrays (showcaseMessages / blockKitMessages) and labels, keeping clearShowcaseChannel where needed before invoking the helper and ensuring the helper uses message.fallbackText and the message-specific payload fields (blocks / attachments) when posting.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (27)
apps/showcase-bot/config.yamlapps/showcase-bot/package.jsonapps/showcase-bot/src/listeners/commands/showcase.tsapps/showcase-bot/src/messages/block-kit-messages.tspackages/block-kit/README.mdpackages/block-kit/package.jsonpackages/block-kit/src/blocks.test.tspackages/block-kit/src/blocks.tspackages/block-kit/src/composition.test.tspackages/block-kit/src/composition.tspackages/block-kit/src/elements.test.tspackages/block-kit/src/elements.tspackages/block-kit/src/index.tspackages/block-kit/src/inputs.test.tspackages/block-kit/src/inputs.tspackages/block-kit/src/rich-text.test.tspackages/block-kit/src/rich-text.tspackages/block-kit/src/selects.test.tspackages/block-kit/src/selects.tspackages/block-kit/src/surfaces.test.tspackages/block-kit/src/surfaces.tspackages/block-kit/src/tables.test.tspackages/block-kit/src/tables.tspackages/block-kit/src/text.test.tspackages/block-kit/src/text.tspackages/block-kit/src/types.tspackages/block-kit/tsconfig.json
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,js,jsx}: Use camelCase for variable names in TypeScript/JavaScript code
No semicolons in code, enforced by Prettier
Use single quotes instead of double quotes
Use trailing commas in es5 format
Prefix unused variables with underscore (_)
Files:
apps/showcase-bot/src/listeners/commands/showcase.tspackages/block-kit/src/surfaces.tspackages/block-kit/src/tables.tspackages/block-kit/src/composition.test.tspackages/block-kit/src/blocks.test.tspackages/block-kit/src/tables.test.tspackages/block-kit/src/elements.test.tspackages/block-kit/src/composition.tspackages/block-kit/src/blocks.tsapps/showcase-bot/src/messages/block-kit-messages.tspackages/block-kit/src/inputs.test.tspackages/block-kit/src/inputs.tspackages/block-kit/src/text.tspackages/block-kit/src/selects.test.tspackages/block-kit/src/text.test.tspackages/block-kit/src/surfaces.test.tspackages/block-kit/src/rich-text.test.tspackages/block-kit/src/selects.tspackages/block-kit/src/elements.tspackages/block-kit/src/rich-text.tspackages/block-kit/src/index.tspackages/block-kit/src/types.ts
**/*.test.ts
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.test.ts: Test files should be colocated with source code using*.test.tsnaming convention
Use Bun's built-in test runner (bun:test) for all tests
Files:
packages/block-kit/src/composition.test.tspackages/block-kit/src/blocks.test.tspackages/block-kit/src/tables.test.tspackages/block-kit/src/elements.test.tspackages/block-kit/src/inputs.test.tspackages/block-kit/src/selects.test.tspackages/block-kit/src/text.test.tspackages/block-kit/src/surfaces.test.tspackages/block-kit/src/rich-text.test.ts
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: tyom/botarium PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-20T00:31:35.696Z
Learning: Applies to packages/core/**/*.{ts,tsx} : Implement the `BotariumPlugin` interface for platform-specific plugins in `packages/core`
📚 Learning: 2026-02-20T00:31:35.696Z
Learnt from: CR
Repo: tyom/botarium PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-20T00:31:35.696Z
Learning: Applies to **/*.test.ts : Use Bun's built-in test runner (`bun:test`) for all tests
Applied to files:
packages/block-kit/src/composition.test.tspackages/block-kit/src/blocks.test.tspackages/block-kit/src/tables.test.tspackages/block-kit/src/elements.test.tspackages/block-kit/src/inputs.test.tspackages/block-kit/src/selects.test.tspackages/block-kit/src/text.test.tspackages/block-kit/src/surfaces.test.tspackages/block-kit/src/rich-text.test.ts
📚 Learning: 2026-02-20T00:31:35.696Z
Learnt from: CR
Repo: tyom/botarium PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-20T00:31:35.696Z
Learning: Applies to **/*.test.ts : Test files should be colocated with source code using `*.test.ts` naming convention
Applied to files:
packages/block-kit/tsconfig.json
📚 Learning: 2026-02-20T00:31:35.696Z
Learnt from: CR
Repo: tyom/botarium PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-20T00:31:35.696Z
Learning: Applies to packages/mrkdwn/src/**/*.ts : Slack mrkdwn converter must provide bidirectional conversion (mrkdwn to HTML and Markdown to mrkdwn)
Applied to files:
packages/block-kit/src/text.tspackages/block-kit/src/text.test.tspackages/block-kit/src/index.tspackages/block-kit/src/types.ts
📚 Learning: 2026-02-20T00:31:35.696Z
Learnt from: CR
Repo: tyom/botarium PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-20T00:31:35.696Z
Learning: Applies to packages/core/**/*.{ts,tsx} : Implement the `BotariumPlugin` interface for platform-specific plugins in `packages/core`
Applied to files:
packages/block-kit/package.jsonpackages/block-kit/src/index.ts
🧬 Code graph analysis (8)
apps/showcase-bot/src/listeners/commands/showcase.ts (3)
apps/showcase-bot/src/messages/block-kit-messages.ts (1)
blockKitMessages(50-815)apps/showcase-bot/src/utils/logger.ts (1)
slackLogger(23-23)packages/block-kit/src/surfaces.ts (1)
modal(4-24)
packages/block-kit/src/tables.ts (2)
packages/block-kit/src/index.ts (4)
cell(55-55)rawCell(55-55)table(55-55)simpleTable(55-55)packages/block-kit/src/types.ts (5)
RichTextStyle(280-286)RichTextBlock(416-420)RawTextElement(423-426)TableColumnSettings(429-432)TableBlock(434-439)
packages/block-kit/src/elements.test.ts (3)
packages/block-kit/src/elements.ts (8)
button(17-33)image(35-37)overflow(39-50)radioButtons(52-67)checkboxes(69-83)datePicker(85-103)timePicker(105-124)dateTimePicker(126-139)packages/block-kit/src/index.ts (9)
button(4-4)image(5-5)options(2-2)overflow(6-6)radioButtons(7-7)checkboxes(8-8)datePicker(9-9)timePicker(10-10)dateTimePicker(11-11)packages/block-kit/src/composition.ts (1)
options(23-25)
packages/block-kit/src/inputs.test.ts (1)
packages/block-kit/src/inputs.ts (5)
textInput(11-30)emailInput(32-49)urlInput(51-68)numberInput(70-91)fileInput(93-105)
packages/block-kit/src/inputs.ts (2)
packages/block-kit/src/types.ts (6)
PlainTextObject(2-6)PlainTextInputElement(127-135)EmailInputElement(148-154)UrlInputElement(156-162)NumberInputElement(137-146)FileInputElement(164-169)packages/block-kit/src/text.ts (1)
resolvePlainText(12-16)
packages/block-kit/src/selects.test.ts (3)
packages/block-kit/src/composition.ts (1)
options(23-25)packages/block-kit/src/index.ts (11)
options(2-2)staticSelect(21-21)multiStaticSelect(22-22)usersSelect(23-23)multiUsersSelect(24-24)conversationsSelect(25-25)multiConversationsSelect(26-26)channelsSelect(27-27)multiChannelsSelect(28-28)externalSelect(29-29)multiExternalSelect(30-30)packages/block-kit/src/selects.ts (10)
staticSelect(18-37)multiStaticSelect(39-58)usersSelect(60-76)multiUsersSelect(78-95)conversationsSelect(97-113)multiConversationsSelect(115-132)channelsSelect(134-150)multiChannelsSelect(152-169)externalSelect(171-188)multiExternalSelect(190-208)
packages/block-kit/src/surfaces.test.ts (3)
packages/block-kit/src/surfaces.ts (2)
modal(4-24)homeTab(26-38)packages/block-kit/src/index.ts (4)
modal(56-56)section(33-33)divider(36-36)homeTab(56-56)packages/block-kit/src/blocks.ts (2)
section(17-26)divider(50-55)
packages/block-kit/src/rich-text.ts (2)
packages/block-kit/src/index.ts (11)
richText(43-43)richLink(44-44)richEmoji(45-45)richUserMention(46-46)richChannelMention(47-47)richBroadcast(48-48)richSection(49-49)richPreformatted(50-50)richQuote(51-51)richList(52-52)richTextBlock(53-53)packages/block-kit/src/types.ts (14)
RichTextStyle(280-286)RichTextTextElement(288-292)RichTextLinkElement(294-299)RichTextEmojiElement(301-306)RichTextUserMentionElement(308-312)RichTextChannelMentionElement(314-318)RichTextBroadcastElement(320-324)RichTextInlineElement(326-332)RichTextSectionElement(334-337)RichTextPreformattedElement(339-343)RichTextQuoteElement(345-349)RichTextListElement(351-357)RichTextBlockElement(359-363)RichTextBlock(416-420)
🔇 Additional comments (62)
packages/block-kit/README.md (1)
1-208: Documentation is clear and comprehensive. The examples cover the main API surface and design principles, which should make onboarding straightforward.packages/block-kit/package.json (1)
1-19: Package manifest looks consistent. Exports and scripts align with the new package setup.packages/block-kit/tsconfig.json (1)
1-5: TS config is minimal and aligned with the repo setup.apps/showcase-bot/package.json (1)
14-20: Workspace dependency wiring is tidy.apps/showcase-bot/src/messages/block-kit-messages.ts (1)
41-48: Date helpers are straightforward and readable.apps/showcase-bot/config.yaml (1)
11-13: Usage hint update matches the new command option.packages/block-kit/src/text.ts (1)
1-21: Text helpers are concise and consistent.packages/block-kit/src/text.test.ts (2)
4-12: Plain text helper coverage looks solid.
14-21: Mrkdwn helper test is clear and correct.packages/block-kit/src/tables.test.ts (4)
4-25: cell() tests validate structure and styling well.
27-31: rawCell() test is concise and accurate.
33-46: table() tests cover core shape and options.
48-74: simpleTable() header styling test looks good.packages/block-kit/src/surfaces.ts (2)
4-24: modal() builder is clean and consistent with text resolution.
26-37: homeTab() builder is straightforward and correct.packages/block-kit/src/tables.ts (4)
9-25: cell() helper is well-structured and idiomatic.
27-29: rawCell() helper is minimal and correct.
31-39: table() builder cleanly composes rows and options.
42-51: simpleTable() logic is clear and consistent.packages/block-kit/src/composition.ts (3)
9-21: option() helper handles text resolution and optional description well.
23-25: options() helper is concise and correct.
27-40: confirmDialog() assembly is clear and consistent.packages/block-kit/src/composition.test.ts (3)
5-30: option() tests cover strings, descriptions, and pre-formed text.
32-48: options() tuple mapping test looks solid.
50-90: confirmDialog() tests cover key variants and style.packages/block-kit/src/inputs.ts (5)
11-30: textInput() builder looks clean and predictable.
32-49: emailInput() builder is straightforward and correct.
51-68: urlInput() builder is clear and consistent.
70-91: numberInput() defaulting behaviour is well-handled.
93-105: fileInput() builder is concise and correct.packages/block-kit/src/inputs.test.ts (5)
10-34: textInput() tests are thorough and accurate.
36-43: emailInput() test is clear and sufficient.
45-52: urlInput() test reads well and checks the shape.
54-65: numberInput() tests correctly cover defaults and decimals.
67-83: fileInput() tests cover options and defaults well.packages/block-kit/src/rich-text.ts (4)
20-87: Inline rich-text factories are tidy and consistent.
Optional fields are only emitted when provided, which aligns well with the types.
89-93: resolveInline keeps string inputs ergonomic.
Nice, minimal helper for normalising section elements.
97-139: Block-level rich-text builders look good.
The element mapping and optional props handling are clear and predictable.
143-151: Top-level rich_text block builder is straightforward.packages/block-kit/src/rich-text.test.ts (2)
1-90: Inline element tests cover the expected shapes well.
91-145: Block-level rich-text tests are solid and readable.packages/block-kit/src/blocks.ts (5)
17-37: Section builders correctly normalise mrkdwn inputs.
39-55: Header/divider builders are clean and correct.
57-77: Actions/context builders look consistent.
79-97: Input block builder handles optional hint nicely.
99-112: Image block builder matches the expected Slack shape.packages/block-kit/src/surfaces.test.ts (2)
5-44: Modal tests cover structure and optional fields well.
46-64: Home tab tests look good.apps/showcase-bot/src/listeners/commands/showcase.ts (2)
101-138: Help text and subcommand wiring align nicely.
152-252: Modal DSL usage is clear and compact.packages/block-kit/src/elements.ts (4)
17-50: Button/image/overflow builders are straightforward and clean.
52-83: Radio buttons and checkboxes builders look good.
85-124: Date/time picker builders handle placeholders neatly.
126-138: Date-time picker builder is simple and correct.packages/block-kit/src/blocks.test.ts (2)
16-75: Core block builders are well covered by tests.
77-145: Actions/context/input/imageBlock tests look solid.packages/block-kit/src/selects.ts (3)
18-58: Static select builders correctly resolve placeholders.
60-169: User/conversation/channel select builders are consistent.
171-207: External select builders look correct.packages/block-kit/src/elements.test.ts (1)
1-129: Well-structured test suite for element builders.The tests correctly use Bun's test runner as per guidelines, follow proper naming conventions, and provide good coverage of the core element builder APIs including options handling and placeholder resolution.
Minor consideration: you may want to add tests for
checkboxeswithinitial_optionsandtimePickerwithplaceholder/initial_timeoptions to match the coverage depth ofradioButtonsanddatePicker, but this can be deferred.packages/block-kit/src/selects.test.ts (1)
1-117: Good baseline test coverage for select builders.All ten select builder functions are tested for correct type and action_id output. The
staticSelecttests additionally verify placeholder resolution, which aligns with the pattern established inelements.test.ts.Consider adding tests for select-specific options like
initial_user,initial_channel,max_selected_items, etc., in a follow-up to ensure full API coverage.packages/block-kit/src/index.ts (1)
1-58: Clean barrel export consolidating the public API.The index file provides a well-organised single entry point for consumers of the
@botarium/block-kitpackage. Exports are logically grouped by module, and theexport type *pattern correctly re-exports type definitions without runtime overhead.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/showcase-bot/src/messages/block-kit-messages.ts`:
- Around line 347-372: Several string literals in the block-kit message calls
use double quotes to accommodate apostrophes; update those to single-quoted
strings and escape internal apostrophes appropriately (for example in the
section(...) calls that contain "Toby's Going Away Party", "Please join me in
welcoming our 3 *new hires* ...", and the context([...]) string), ensuring you
update all similar occurrences between the section(...), button(...), and
context(...) usages so they follow the project's single-quote convention.
In `@packages/block-kit/src/types.ts`:
- Around line 237-255: The BlockElement union is missing
MultiStaticSelectElement, so multiStaticSelect elements are not recognized;
update the BlockElement type (the union that currently lists ButtonElement,
ImageElement, StaticSelectElement, ... MultiExternalSelectElement) to include
MultiStaticSelectElement among its members so multiStaticSelect can be used in
actions and section accessories without casting.
---
Nitpick comments:
In `@apps/showcase-bot/src/listeners/commands/showcase.ts`:
- Around line 74-99: Extract a shared helper (e.g., sendMessages or
postMessagesToShowcase) that takes (client, messages, successLogLabel,
failureLogLabel) or similar and moves the loop, try/catch,
client.chat.postMessage call, error logging (slackLogger.error) and final info
logging (slackLogger.info) into it; then refactor sendShowcaseMessages and
sendBlockKitMessages to call this helper with their respective message arrays
(showcaseMessages / blockKitMessages) and labels, keeping clearShowcaseChannel
where needed before invoking the helper and ensuring the helper uses
message.fallbackText and the message-specific payload fields (blocks /
attachments) when posting.
…showcase messages - Add missing MultiStaticSelectElement to BlockElement type so multiStaticSelect works in actions/section accessories without casting - Rename fallbackText to optional text to match Slack API convention - Extract shared postMessages helper to deduplicate send logic
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
apps/showcase-bot/src/listeners/commands/showcase.tsapps/showcase-bot/src/messages/block-kit-messages.tsapps/showcase-bot/src/messages/blocks/01-text-and-layout.jsonapps/showcase-bot/src/messages/blocks/02-button-variations.jsonapps/showcase-bot/src/messages/blocks/03-selection-elements.jsonapps/showcase-bot/src/messages/blocks/04-radio-and-checkboxes.jsonapps/showcase-bot/src/messages/blocks/05-date-and-time-pickers.jsonapps/showcase-bot/src/messages/blocks/06-section-accessories.jsonapps/showcase-bot/src/messages/blocks/07-combined-actions.jsonapps/showcase-bot/src/messages/showcase-messages.tspackages/block-kit/src/types.ts
✅ Files skipped from review due to trivial changes (4)
- apps/showcase-bot/src/messages/blocks/07-combined-actions.json
- apps/showcase-bot/src/messages/blocks/05-date-and-time-pickers.json
- apps/showcase-bot/src/messages/blocks/03-selection-elements.json
- apps/showcase-bot/src/messages/blocks/04-radio-and-checkboxes.json
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,js,jsx}: Use camelCase for variable names in TypeScript/JavaScript code
No semicolons in code, enforced by Prettier
Use single quotes instead of double quotes
Use trailing commas in es5 format
Prefix unused variables with underscore (_)
Files:
apps/showcase-bot/src/messages/block-kit-messages.tsapps/showcase-bot/src/messages/showcase-messages.tsapps/showcase-bot/src/listeners/commands/showcase.tspackages/block-kit/src/types.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: tyom/botarium PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-20T00:31:35.696Z
Learning: Applies to packages/core/**/*.{ts,tsx} : Implement the `BotariumPlugin` interface for platform-specific plugins in `packages/core`
📚 Learning: 2026-02-20T00:31:35.696Z
Learnt from: CR
Repo: tyom/botarium PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-20T00:31:35.696Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use single quotes instead of double quotes
Applied to files:
apps/showcase-bot/src/messages/block-kit-messages.ts
📚 Learning: 2026-02-20T00:31:35.696Z
Learnt from: CR
Repo: tyom/botarium PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-20T00:31:35.696Z
Learning: Applies to packages/mrkdwn/src/**/*.ts : Slack mrkdwn converter must provide bidirectional conversion (mrkdwn to HTML and Markdown to mrkdwn)
Applied to files:
packages/block-kit/src/types.ts
🧬 Code graph analysis (1)
apps/showcase-bot/src/listeners/commands/showcase.ts (4)
packages/block-kit/src/types.ts (1)
Block(443-452)apps/showcase-bot/src/utils/logger.ts (1)
slackLogger(23-23)apps/showcase-bot/src/messages/showcase-messages.ts (1)
showcaseMessages(30-33)packages/block-kit/src/surfaces.ts (1)
modal(4-24)
🔇 Additional comments (8)
apps/showcase-bot/src/messages/blocks/02-button-variations.json (1)
2-2: Looks good: the top-leveltextfield aligns with the updated payload shape.apps/showcase-bot/src/messages/blocks/01-text-and-layout.json (1)
2-2: LGTM: switching totextis consistent with the other showcase payloads.apps/showcase-bot/src/messages/blocks/06-section-accessories.json (1)
2-2: Looks good: top-leveltextkeeps payloads uniform.apps/showcase-bot/src/messages/showcase-messages.ts (1)
5-8: LGTM: optionaltextmatches the updated message payloads.apps/showcase-bot/src/listeners/commands/showcase.ts (3)
47-86: Nice reuse withpostMessagesand the block‑kit sender.
88-95: Help text and subcommand wiring look consistent.Also applies to: 122-124
135-239: DSL-based modal reads cleanly and covers all inputs.packages/block-kit/src/types.ts (1)
40-47: Slack Block Kit payloads intentionally use snake_case field names for API compatibility.The coding guideline specifies camelCase for TypeScript/JavaScript variables, but the
@typescript-eslint/naming-conventionrule is not currently enabled in the ESLint configuration. These field names (e.g.action_id,image_url,alt_text) intentionally mirror Slack's API contract and should remain as-is. Consider documenting this exemption in the file or adding a comment clarifying that this package deliberately uses snake_case to match Slack's Block Kit specification.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/block-kit/src/types.ts`:
- Around line 8-11: The MrkdwnObject interface is missing the optional verbatim
flag required by Slack Block Kit; update the MrkdwnObject interface to include
verbatim?: boolean (optional) so consumers can specify verbatim behavior
(default false at runtime), e.g., add the verbatim?: boolean property to the
exported MrkdwnObject type declaration to match Slack's spec.
- Around line 65-72: The MultiStaticSelectElement type is missing the optional
confirm field; update the interface MultiStaticSelectElement to include
confirm?: ConfirmObject (matching the other interactive element types), so the
multi_static_select supports an optional confirmation dialog; locate the
MultiStaticSelectElement declaration and add the confirm?: ConfirmObject
property with the same type used by other elements (e.g., the confirm field on
Button, StaticSelect, Checkbox, RadioButton, Overflow) to keep consistency.
---
Duplicate comments:
In `@apps/showcase-bot/src/messages/block-kit-messages.ts`:
- Around line 347-372: Replace double-quoted string literals with single-quoted
ones in the block-kit message definitions where they currently use double quotes
(e.g., the section("...") calls and the context([...]) array entries) so they
follow the project style rule "Use single quotes instead of double quotes";
update each offending literal in the section, divider, and context usages
(including the occurrences around the Toby event, the newsletter text and the
context pushpin string) to single-quoted strings.
Add verbatim to MrkdwnObject and confirm to MultiStaticSelectElement to match Slack Block Kit spec.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
packages/block-kit/src/types.ts (2)
457-476: Consider moving modal-specific fields out ofBaseView.The
submitandclosefields inBaseVieware only applicable toModalView, notHomeTabView. Having them in the base interface could lead to confusion or invalid payloads when constructing home tab views. Consider restructuring so these fields are only present onModalView.🔧 Suggested restructure
interface BaseView { blocks: Block[] private_metadata?: string callback_id?: string - title?: PlainTextObject - submit?: PlainTextObject - close?: PlainTextObject - clear_on_close?: boolean - notify_on_close?: boolean external_id?: string } export interface ModalView extends BaseView { type: 'modal' title: PlainTextObject + submit?: PlainTextObject + close?: PlainTextObject + clear_on_close?: boolean + notify_on_close?: boolean } export interface HomeTabView extends BaseView { type: 'home' }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/block-kit/src/types.ts` around lines 457 - 476, BaseView currently includes modal-only fields submit and close which can produce invalid HomeTabView payloads; remove submit and close (and any modal-only properties) from the BaseView interface and add them to ModalView so only ModalView exposes submit and close; update the BaseView definition used by HomeTabView to exclude those properties and adjust any code that constructs views (references to BaseView, ModalView, HomeTabView) to use the new ModalView fields when creating modals.
92-98: Addfocus_on_loadtoCheckboxesElement.The Slack Block Kit specification supports the optional
focus_on_loadproperty for checkboxes. Other interactive input elements in this file (RadioButtonsElement,DatePickerElement,TimePickerElement,DateTimePickerElement) include this property, butCheckboxesElementis missing it.🔧 Suggested change
export interface CheckboxesElement { type: 'checkboxes' action_id: string options: Option[] initial_options?: Option[] confirm?: ConfirmDialog + focus_on_load?: boolean }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/block-kit/src/types.ts` around lines 92 - 98, The CheckboxesElement interface is missing the optional focus_on_load property supported by Slack; add an optional boolean property named focus_on_load to the CheckboxesElement interface in packages/block-kit/src/types.ts (matching the pattern used on RadioButtonsElement, DatePickerElement, TimePickerElement, DateTimePickerElement) so the interface reads like the others and accepts focus_on_load?: boolean.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/block-kit/src/types.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,js,jsx}: Use camelCase for variable names in TypeScript/JavaScript code
No semicolons in code, enforced by Prettier
Use single quotes instead of double quotes
Use trailing commas in es5 format
Prefix unused variables with underscore (_)
Files:
packages/block-kit/src/types.ts
🧠 Learnings (1)
📚 Learning: 2026-02-20T00:31:35.696Z
Learnt from: CR
Repo: tyom/botarium PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-20T00:31:35.696Z
Learning: Applies to packages/mrkdwn/src/**/*.ts : Slack mrkdwn converter must provide bidirectional conversion (mrkdwn to HTML and Markdown to mrkdwn)
Applied to files:
packages/block-kit/src/types.ts
🔇 Additional comments (4)
packages/block-kit/src/types.ts (4)
1-14: LGTM!Text object types are correctly defined and align with Slack Block Kit specification. The
verbatimfield onMrkdwnObjecthas been correctly added.
16-37: LGTM!The
ConfirmDialog,Option, andOverflowOptiontypes are well-structured and match the Slack Block Kit specification.
239-279: LGTM!The
BlockElementandInputElementunions are comprehensive and correctly include all relevant element types. The previously missingMultiStaticSelectElementhas been added toBlockElement.
281-366: LGTM!The rich text type definitions are well-structured, covering all inline elements and block-level constructs. The
RichTextStyleinterface and element unions provide a solid foundation for building rich text content.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/block-kit/src/types.ts`:
- Around line 129-137: PlainTextInputElement is missing the optional
focus_on_load property that other input types support; update the
PlainTextInputElement interface to include focus_on_load?: boolean so it matches
NumberInputElement/EmailInputElement/UrlInputElement and Slack Block Kit's spec
(look for the PlainTextInputElement type in types.ts and add the optional
field).
- Around line 175-235: The listed workspace select interfaces are missing the
optional confirm property; add an optional confirm?: ConfirmObject to
UsersSelectElement, ConversationsSelectElement, ChannelsSelectElement,
ExternalSelectElement and their multi-select counterparts
(MultiUsersSelectElement, MultiConversationsSelectElement,
MultiChannelsSelectElement, MultiExternalSelectElement) following the same
pattern used by StaticSelectElement/MultiStaticSelectElement so they support
Slack confirmation dialogs and use the existing ConfirmObject type.
- Around line 437-442: The TableBlock.rows type currently uses RichTextBlock
which contains an optional block_id not allowed in table cells; update the union
used by TableBlock.rows to use a new lightweight rich-text cell type (e.g.,
RichTextCell) that matches Slack's cell shape (no block_id, only elements array)
or redefine the union to exclude block_id from RichTextBlock, and replace
references in TableBlock.rows so rows: (RichTextCell | RawTextElement)[][].
Modify or add a type (RichTextCell) to mirror RichTextBlock.elements and ensure
TableColumnSettings and other consumers still compile.
---
Nitpick comments:
In `@packages/block-kit/src/types.ts`:
- Around line 457-476: BaseView currently includes modal-only fields submit and
close which can produce invalid HomeTabView payloads; remove submit and close
(and any modal-only properties) from the BaseView interface and add them to
ModalView so only ModalView exposes submit and close; update the BaseView
definition used by HomeTabView to exclude those properties and adjust any code
that constructs views (references to BaseView, ModalView, HomeTabView) to use
the new ModalView fields when creating modals.
- Around line 92-98: The CheckboxesElement interface is missing the optional
focus_on_load property supported by Slack; add an optional boolean property
named focus_on_load to the CheckboxesElement interface in
packages/block-kit/src/types.ts (matching the pattern used on
RadioButtonsElement, DatePickerElement, TimePickerElement,
DateTimePickerElement) so the interface reads like the others and accepts
focus_on_load?: boolean.
- Add focus_on_load to PlainTextInputElement and CheckboxesElement - Add confirm dialog support to all workspace select elements - Introduce RichTextCell type for table cells (no block_id) - Move modal-only fields (submit, close, etc.) from BaseView to ModalView
Summary
@botarium/block-kit— a zero-dependency package of factory functions that eliminate Block Kit JSON verbosity (e.g. a 247-linetable JSON becomes ~10 lines of TypeScript)
/showcase block-kitposts all 16 messages built with block-kit functions, alongside theexisting
/showcase generateJSON path/showcase modalfrom 215 lines of raw JSON to ~15 lines of block-kit callsViewtype intoModalView/HomeTabViewfor structural compatibility with@slack/typesWhat's in the package
Factory functions for every Block Kit building block:
header(),section(),divider(),actions(),context(),input(),imageBlock()button(),datePicker(),timePicker(),radioButtons(),checkboxes(), etc.textInput(),emailInput(),urlInput(),numberInput(),fileInput()staticSelect(),usersSelect(),channelsSelect(), and all multi- variantsrichTextBlock(),richSection(),richList(),richQuote(),richPreformatted()table(),cell(),simpleTable()modal(),homeTab()option(),options(),confirmDialog()String-first API — pass strings where Slack expects text objects; they auto-wrap as
mrkdwnorplain_textdepending on context.Test plan
/showcase block-kit— messages appear in #showcase matching/showcase generate/showcase modal— modal opens correctly with all 13 input fields/showcase generate— original JSON path still works unchangedSummary by CodeRabbit
New Features
Bug Fixes / Behaviour
Documentation
Tests