feat(model): add carousel and card Block Kit blocks#1608
Closed
zimeg wants to merge 1 commit into
Closed
Conversation
Add the `carousel` layout block and its `card` element to the slack-api-model block model. - CarouselBlock (type "carousel"): elements (1-10 CardBlock), block_id - CardBlock (type "card"): hero_image, icon, slack_icon, title, subtitle, body, subtext, actions, block_id - Register both in GsonLayoutBlockFactory - Add Blocks.carousel(...) and Blocks.card(...) DSL helpers - Add parse + round-trip tests in BlockKitTest Refs: - https://docs.slack.dev/reference/block-kit/blocks/carousel-block - https://docs.slack.dev/reference/block-kit/blocks/card-block Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1608 +/- ##
============================================
- Coverage 73.32% 73.30% -0.03%
- Complexity 4520 4521 +1
============================================
Files 478 478
Lines 14300 14304 +4
Branches 1490 1490
============================================
Hits 10486 10486
- Misses 2923 2926 +3
- Partials 891 892 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Member
Author
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.
Summary
Adds the
carousellayout block and itscardelement to theslack-api-modelblock model, following the existing block conventions (Lombok@Data @Builder,TYPEconstant, factory registration, DSL helper, round-trip test).CarouselBlock(typecarousel):elements(1-10CardBlock),blockIdCardBlock(typecard):heroImage,icon,slackIcon,title,subtitle,body,subtext,actions(anActionsBlock, max 3 buttons),blockId. At least one ofheroImage/title/actions/bodymust be present.GsonLayoutBlockFactoryBlocks.carousel(...)andBlocks.card(...)DSL helpersparseCarouselBlockandbuildCarouselBlock(round-trip) tests inBlockKitTestThe
cardblock is included becausecarousel.elements[]is an array of card blocks — the carousel cannot be modeled or tested without it. Both are net-new to the Java SDK.Docs
Validation
Ran the touched package's tests:
Note on
-Djacoco.skip=true: this environment only has JDK 25 available, and the repo-pinned JaCoCo 0.8.7 cannot instrument Java 25 class files (Unsupported class file major version 69), which fails coverage instrumentation on every test regardless of changes. JaCoCo coverage was therefore skipped for local validation; compilation and all unit tests (including the 2 new carousel tests) pass.No
.changeset/exists in this repo (Maven build, versioned via release tooling), so no changeset was added.🤖 Generated with Claude Code
Co-Authored-By: Claude svc-devxp-claude@slack-corp.com