Skip to content

feat(model): add carousel Block Kit block#1614

Draft
zimeg wants to merge 1 commit into
chore/block-kit-cardfrom
chore/block-kit-carousel
Draft

feat(model): add carousel Block Kit block#1614
zimeg wants to merge 1 commit into
chore/block-kit-cardfrom
chore/block-kit-carousel

Conversation

@zimeg

@zimeg zimeg commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary

Adds only the carousel Block Kit layout block (one block, one PR). A carousel is a horizontally scrollable collection of card blocks (1-10 cards).

Changes:

  • New CarouselBlock model — TYPE = "carousel", elements: List<CardBlock> (1-10), blockId
  • Blocks.carousel(...) builder factory
  • GsonLayoutBlockFactory carousel case for (de)serialization
  • BlockKitTest parse + build/round-trip coverage

Docs: https://docs.slack.dev/reference/block-kit/blocks/carousel-block

Dependency

CarouselBlock.elements is a List<CardBlock>, so this depends on the card block from #1609 (chore/block-kit-card). This PR is based on chore/block-kit-card, not main. Once #1609 merges to main, rebase this branch onto main and retarget the base to main.

This replaces the carousel half of the now-superseded #1608 (which bundled card + carousel). #1608 will be closed separately.

Validation

  • ./mvnw -pl slack-api-model -Dtest=BlockKitTest testTests run: 47, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS
  • (Note: a JaCoCo coverage-instrumentation warning about "class file major version 69" appears under JDK 25; it is unrelated to this change and does not fail the build.)

🤖 Generated with Claude Code

Add the carousel layout block, a horizontally scrollable collection of
card blocks (1-10 cards).

- CarouselBlock model (TYPE "carousel", elements: List<CardBlock>, blockId)
- Blocks.carousel(...) factory
- GsonLayoutBlockFactory carousel case for (de)serialization
- BlockKitTest parse + build/round-trip coverage

Ref: https://docs.slack.dev/reference/block-kit/blocks/carousel-block

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.32%. Comparing base (0712684) to head (fa3683f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                    Coverage Diff                     @@
##             chore/block-kit-card    #1614      +/-   ##
==========================================================
+ Coverage                   73.29%   73.32%   +0.03%     
- Complexity                   4521     4523       +2     
==========================================================
  Files                         478      478              
  Lines                       14302    14304       +2     
  Branches                     1490     1490              
==========================================================
+ Hits                        10482    10488       +6     
+ Misses                       2932     2924       -8     
- Partials                      888      892       +4     
Flag Coverage Δ
jdk-14 73.32% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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