Skip to content

Comments

Add @botarium/block-kit package with showcase bot integration#15

Merged
tyom merged 6 commits intomainfrom
block-kit
Feb 22, 2026
Merged

Add @botarium/block-kit package with showcase bot integration#15
tyom merged 6 commits intomainfrom
block-kit

Conversation

@tyom
Copy link
Owner

@tyom tyom commented Feb 22, 2026

Summary

  • Add @botarium/block-kit — a zero-dependency package of factory functions that eliminate Block Kit JSON verbosity (e.g. a 247-line
    table JSON becomes ~10 lines of TypeScript)
  • Dogfood the package in the showcase bot: /showcase block-kit posts all 16 messages built with block-kit functions, alongside the
    existing /showcase generate JSON path
  • Convert the inline modal in /showcase modal from 215 lines of raw JSON to ~15 lines of block-kit calls
  • Split the block-kit View type into ModalView/HomeTabView for structural compatibility with @slack/types

What's in the package

Factory functions for every Block Kit building block:

  • Blocks: header(), section(), divider(), actions(), context(), input(), imageBlock()
  • Elements: button(), datePicker(), timePicker(), radioButtons(), checkboxes(), etc.
  • Inputs: textInput(), emailInput(), urlInput(), numberInput(), fileInput()
  • Selects: staticSelect(), usersSelect(), channelsSelect(), and all multi- variants
  • Rich text: richTextBlock(), richSection(), richList(), richQuote(), richPreformatted()
  • Tables: table(), cell(), simpleTable()
  • Surfaces: modal(), homeTab()
  • Composition: option(), options(), confirmDialog()

String-first API — pass strings where Slack expects text objects; they auto-wrap as mrkdwn or plain_text depending 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 unchanged

Summary by CodeRabbit

  • New Features

    • New Block Kit package with builders and a gallery of ready-made message templates.
    • Added /showcase block-kit command to view Block Kit message templates and modal examples.
    • Modal builder now uses a DSL for richer, more consistent modal layouts.
  • Bug Fixes / Behaviour

    • Several showcase messages now use a primary "text" label instead of "fallbackText".
    • /showcase usage hint updated to include the block-kit subcommand.
  • Documentation

    • Comprehensive README added for the Block Kit package.
  • Tests

    • Extensive tests added for Block Kit builders and utilities.

tyom added 3 commits February 22, 2026 15:01
…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
@coderabbitai
Copy link

coderabbitai bot commented Feb 22, 2026

No actionable comments were generated in the recent review. 🎉

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 15517e4 and c59b3b8.

📒 Files selected for processing (2)
  • packages/block-kit/src/tables.ts
  • packages/block-kit/src/types.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/block-kit/src/tables.ts
  • packages/block-kit/src/types.ts

📝 Walkthrough

Walkthrough

Adds a new @botarium/block-kit package (builders, types, tests, README), integrates it into the showcase bot with a block-kit messages catalog and a /showcase block-kit subcommand, refactors the /showcase modal to use the Block Kit DSL, and renames/remakes several example JSON fields and the ShowcaseMessage shape.

Changes

Cohort / File(s) Summary
Package manifest & docs
packages/block-kit/package.json, packages/block-kit/tsconfig.json, packages/block-kit/README.md
New package metadata, TS config and documentation for @botarium/block-kit.
Types & text primitives
packages/block-kit/src/types.ts, packages/block-kit/src/text.ts
Adds comprehensive Block Kit TypeScript types and text helper factories/resolvers (plainText, mrkdwn, resolve*).
Core blocks & surfaces
packages/block-kit/src/blocks.ts, packages/block-kit/src/surfaces.ts, packages/block-kit/src/index.ts
Block and surface factory functions plus a barrel export consolidating the public API.
Elements, inputs, selects, composition
packages/block-kit/src/elements.ts, packages/block-kit/src/inputs.ts, packages/block-kit/src/selects.ts, packages/block-kit/src/composition.ts
Builder helpers for UI elements, input elements, selects and option/confirm composition; check placeholder resolution and option plumbing.
Rich text & tables
packages/block-kit/src/rich-text.ts, packages/block-kit/src/tables.ts
Rich-text inline/section builders and table helpers (cell, rawCell, table, simpleTable).
Block-kit tests
packages/block-kit/src/*.test.ts
Extensive unit tests added for text, elements, inputs, selects, blocks, surfaces, rich-text, tables and composition.
Showcase integration
apps/showcase-bot/package.json, apps/showcase-bot/config.yaml, apps/showcase-bot/src/listeners/commands/showcase.ts
Workspace dependency added; usage_hint extended; command handler refactored to use Block Kit DSL, new sendBlockKitMessages and /showcase block-kit routing.
Block-kit example messages
apps/showcase-bot/src/messages/block-kit-messages.ts
New module exporting a catalog of prebuilt Block Kit message payloads (computed timestamps included).
Showcase message shape & JSON examples
apps/showcase-bot/src/messages/showcase-messages.ts, apps/showcase-bot/src/messages/blocks/*.json
ShowcaseMessage interface changed (fallbackText → optional text?) and several example JSON files updated to use text instead of fallbackText; verify consumers.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: introducing a new @botarium/block-kit package and integrating it into the showcase bot.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch block-kit

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
sendShowcaseMessages and sendBlockKitMessages only 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

📥 Commits

Reviewing files that changed from the base of the PR and between 86c8796 and 674d6d2.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (27)
  • apps/showcase-bot/config.yaml
  • apps/showcase-bot/package.json
  • apps/showcase-bot/src/listeners/commands/showcase.ts
  • apps/showcase-bot/src/messages/block-kit-messages.ts
  • packages/block-kit/README.md
  • packages/block-kit/package.json
  • packages/block-kit/src/blocks.test.ts
  • packages/block-kit/src/blocks.ts
  • packages/block-kit/src/composition.test.ts
  • packages/block-kit/src/composition.ts
  • packages/block-kit/src/elements.test.ts
  • packages/block-kit/src/elements.ts
  • packages/block-kit/src/index.ts
  • packages/block-kit/src/inputs.test.ts
  • packages/block-kit/src/inputs.ts
  • packages/block-kit/src/rich-text.test.ts
  • packages/block-kit/src/rich-text.ts
  • packages/block-kit/src/selects.test.ts
  • packages/block-kit/src/selects.ts
  • packages/block-kit/src/surfaces.test.ts
  • packages/block-kit/src/surfaces.ts
  • packages/block-kit/src/tables.test.ts
  • packages/block-kit/src/tables.ts
  • packages/block-kit/src/text.test.ts
  • packages/block-kit/src/text.ts
  • packages/block-kit/src/types.ts
  • packages/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.ts
  • packages/block-kit/src/surfaces.ts
  • packages/block-kit/src/tables.ts
  • packages/block-kit/src/composition.test.ts
  • packages/block-kit/src/blocks.test.ts
  • packages/block-kit/src/tables.test.ts
  • packages/block-kit/src/elements.test.ts
  • packages/block-kit/src/composition.ts
  • packages/block-kit/src/blocks.ts
  • apps/showcase-bot/src/messages/block-kit-messages.ts
  • packages/block-kit/src/inputs.test.ts
  • packages/block-kit/src/inputs.ts
  • packages/block-kit/src/text.ts
  • packages/block-kit/src/selects.test.ts
  • packages/block-kit/src/text.test.ts
  • packages/block-kit/src/surfaces.test.ts
  • packages/block-kit/src/rich-text.test.ts
  • packages/block-kit/src/selects.ts
  • packages/block-kit/src/elements.ts
  • packages/block-kit/src/rich-text.ts
  • packages/block-kit/src/index.ts
  • packages/block-kit/src/types.ts
**/*.test.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.test.ts: Test files should be colocated with source code using *.test.ts naming convention
Use Bun's built-in test runner (bun:test) for all tests

Files:

  • packages/block-kit/src/composition.test.ts
  • packages/block-kit/src/blocks.test.ts
  • packages/block-kit/src/tables.test.ts
  • packages/block-kit/src/elements.test.ts
  • packages/block-kit/src/inputs.test.ts
  • packages/block-kit/src/selects.test.ts
  • packages/block-kit/src/text.test.ts
  • packages/block-kit/src/surfaces.test.ts
  • packages/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.ts
  • packages/block-kit/src/blocks.test.ts
  • packages/block-kit/src/tables.test.ts
  • packages/block-kit/src/elements.test.ts
  • packages/block-kit/src/inputs.test.ts
  • packages/block-kit/src/selects.test.ts
  • packages/block-kit/src/text.test.ts
  • packages/block-kit/src/surfaces.test.ts
  • packages/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.ts
  • packages/block-kit/src/text.test.ts
  • packages/block-kit/src/index.ts
  • packages/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.json
  • packages/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 checkboxes with initial_options and timePicker with placeholder/initial_time options to match the coverage depth of radioButtons and datePicker, 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 staticSelect tests additionally verify placeholder resolution, which aligns with the pattern established in elements.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-kit package. Exports are logically grouped by module, and the export 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
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 674d6d2 and e52f0c9.

📒 Files selected for processing (11)
  • apps/showcase-bot/src/listeners/commands/showcase.ts
  • apps/showcase-bot/src/messages/block-kit-messages.ts
  • apps/showcase-bot/src/messages/blocks/01-text-and-layout.json
  • apps/showcase-bot/src/messages/blocks/02-button-variations.json
  • apps/showcase-bot/src/messages/blocks/03-selection-elements.json
  • apps/showcase-bot/src/messages/blocks/04-radio-and-checkboxes.json
  • apps/showcase-bot/src/messages/blocks/05-date-and-time-pickers.json
  • apps/showcase-bot/src/messages/blocks/06-section-accessories.json
  • apps/showcase-bot/src/messages/blocks/07-combined-actions.json
  • apps/showcase-bot/src/messages/showcase-messages.ts
  • packages/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.ts
  • apps/showcase-bot/src/messages/showcase-messages.ts
  • apps/showcase-bot/src/listeners/commands/showcase.ts
  • packages/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-level text field aligns with the updated payload shape.

apps/showcase-bot/src/messages/blocks/01-text-and-layout.json (1)

2-2: LGTM: switching to text is consistent with the other showcase payloads.

apps/showcase-bot/src/messages/blocks/06-section-accessories.json (1)

2-2: Looks good: top-level text keeps payloads uniform.

apps/showcase-bot/src/messages/showcase-messages.ts (1)

5-8: LGTM: optional text matches the updated message payloads.

apps/showcase-bot/src/listeners/commands/showcase.ts (3)

47-86: Nice reuse with postMessages and 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-convention rule 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.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
packages/block-kit/src/types.ts (2)

457-476: Consider moving modal-specific fields out of BaseView.

The submit and close fields in BaseView are only applicable to ModalView, not HomeTabView. 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 on ModalView.

🔧 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: Add focus_on_load to CheckboxesElement.

The Slack Block Kit specification supports the optional focus_on_load property for checkboxes. Other interactive input elements in this file (RadioButtonsElement, DatePickerElement, TimePickerElement, DateTimePickerElement) include this property, but CheckboxesElement is 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

📥 Commits

Reviewing files that changed from the base of the PR and between e52f0c9 and 15517e4.

📒 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 verbatim field on MrkdwnObject has been correctly added.


16-37: LGTM!

The ConfirmDialog, Option, and OverflowOption types are well-structured and match the Slack Block Kit specification.


239-279: LGTM!

The BlockElement and InputElement unions are comprehensive and correctly include all relevant element types. The previously missing MultiStaticSelectElement has been added to BlockElement.


281-366: LGTM!

The rich text type definitions are well-structured, covering all inline elements and block-level constructs. The RichTextStyle interface 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
@tyom tyom merged commit ee3fd9a into main Feb 22, 2026
2 checks passed
@tyom tyom deleted the block-kit branch February 22, 2026 16:30
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.

1 participant