Skip to content

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Oct 22, 2025

This PR adds underline to the rich text section block element style.

Category

  • slack-api-model (Slack API Data Models)

Reviewers

This snippet might be useful in testing:

import com.slack.api.model.block.Blocks.*;
import com.slack.api.model.block.element.RichTextSectionElement;
import static com.slack.api.model.block.Blocks.*;
import static com.slack.api.model.block.element.BlockElements.*;
import static com.slack.api.model.block.element.RichTextSectionElement.*;

var message = RichTextSectionElement.Text.builder()
    .text("important")
    .style(TextStyle.builder().bold(true).underline(true).build())
    .build();
var response = slack.methods().chatPostMessage(r -> r.token(token)
    .blocks(asBlocks(richText(i -> i.elements(asElements(richTextSection(t -> t.elements(asRichTextElements(message))))))))
    .channel("C0123456789"));

Notes

🏁 This style has not been released to all teams yet! Hoping to have this ready to release when this does go public!

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.

@zimeg zimeg added this to the 1.45.5 milestone Oct 22, 2025
@zimeg zimeg self-assigned this Oct 22, 2025
@zimeg zimeg added enhancement M-T: A feature request for new functionality project:slack-api-model project:slack-api-model labels Oct 22, 2025
@zimeg
Copy link
Member Author

zimeg commented Oct 22, 2025

🔍 The following appears for me when listening to an underlined app mention, as expected:

EventsApiPayloadParser.BoltEventPayload(token=WYrBcxySv439PB790UWCuV7N, enterpriseId=null, teamId=T02A074M3U3, apiAppId=A05FURW3A6R, type=event_callback, authedUsers=null, authedTeams=null, authorizations=[Authorization(enterpriseId=null, teamId=T02A074M3U3, userId=U05FURYLBT7, isBot=true, isEnterpriseInstall=false)], isExtSharedChannel=false, eventId=Ev09N61UHUJY, eventTime=1761170877, eventContext=4-eyJldCI6ImFwcF9tZW50aW9uIiwidGlkIjoiVDAyQTA3NE0zVTMiLCJhaWQiOiJBMDVGVVJXM0E2UiIsImNpZCI6IkMwNENSVUU2TVUzIn0, event=AppMentionEvent(type=app_mention, clientMsgId=9c372a7c-7cba-43a8-b3ec-684a31b24f74, user=U04051AF9NJ, username=null, appId=null, botId=null, botProfile=null, subtype=null, text=<@U05FURYLBT7> hello, blocks=[RichTextBlock(type=rich_text, elements=[RichTextSectionElement(type=rich_text_section, elements=[RichTextSectionElement.User(type=user, userId=U05FURYLBT7, style=null), RichTextSectionElement.Text(type=text, text= , style=null), RichTextSectionElement.Text(type=text, text=hello, style=RichTextSectionElement.TextStyle(bold=false, italic=false, strike=false, highlight=false, clientHighlight=false, underline=true, unlink=false, code=false))])], blockId=PZonh)], attachments=null, files=null, upload=null, displayAsBot=null, ts=1761170877.362249, team=T02A074M3U3, channel=C04CRUE6MU3, userTeam=null, sourceTeam=null, userProfile=null, edited=null, eventTs=1761170877.362249, threadTs=null))

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.43%. Comparing base (9504d94) to head (b3cf62a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1522      +/-   ##
============================================
+ Coverage     73.02%   73.43%   +0.40%     
- Complexity     4399     4403       +4     
============================================
  Files           475      475              
  Lines         14266    13947     -319     
  Branches       1452     1452              
============================================
- Hits          10418    10242     -176     
+ Misses         2987     2845     -142     
+ Partials        861      860       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

📰 Leaving comments for kind reviewers!

Copy link
Member Author

Choose a reason for hiding this comment

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

🗣️ note: The line changes to json-logs are results from automated test runs!

Copy link
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

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

💯

Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

👏🏻 Huge feat to add underline support to the Java SDK as well!

Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

@WilliamBergamin @mwbrooks I share the excitement for this format! 📠

For now I will make a small change to tests then merge this since I believe support is rolled out across teams!

@zimeg zimeg enabled auto-merge (squash) October 27, 2025 23:33
@zimeg zimeg merged commit 1317675 into main Oct 27, 2025
6 checks passed
@zimeg zimeg deleted the zimeg-feat-model-rich-text-underline branch October 27, 2025 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality project:slack-api-model project:slack-api-model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants