Skip to content

feat(blocks): add min_lines/max_lines to RichTextInputElement - #1925

Merged
srtaalej merged 2 commits into
mainfrom
feat/rich-text-input-min-max-lines
Jul 29, 2026
Merged

feat(blocks): add min_lines/max_lines to RichTextInputElement#1925
srtaalej merged 2 commits into
mainfrom
feat/rich-text-input-min-max-lines

Conversation

@srtaalej

@srtaalej srtaalej commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds optional min_lines and max_lines integer properties to the RichTextInputElement Block Kit model, allowing developers to control the visible height of rich_text_input elements.

  • min_lines — minimum number of visible lines (1–100)
  • max_lines — maximum number of visible lines before scrolling (1–100, defaults to 8 on the platform when unset)

Both properties are optional, preserving full backward compatibility.

Testing

./scripts/run_tests.sh tests/slack_sdk/models/test_elements.py

New test methods: test_min_lines, test_max_lines, test_min_and_max_lines — all verify round-trip serialization.

Test app.py
import os
import logging

from slack_bolt import App
from slack_bolt.adapter.socket_mode import SocketModeHandler

logging.basicConfig(level=logging.DEBUG)

app = App(token=os.environ.get("SLACK_BOT_TOKEN"))


@app.command("/sample-command")
def open_rich_text_modal(ack, client, body):
    ack()
    client.views_open(
        trigger_id=body["trigger_id"],
        view={
            "type": "modal",
            "title": {"type": "plain_text", "text": "Rich Text Test"},
            "submit": {"type": "plain_text", "text": "Submit"},
            "blocks": [
                {
                    "type": "input",
                    "block_id": "rich_text_block",
                    "label": {"type": "plain_text", "text": "Default (no min/max — should be 8 max)"},
                    "element": {
                        "type": "rich_text_input",
                        "action_id": "default_input",
                    },
                },
                {
                    "type": "input",
                    "block_id": "rich_text_min_block",
                    "label": {"type": "plain_text", "text": "min_lines: 5"},
                    "element": {
                        "type": "rich_text_input",
                        "action_id": "min_input",
                        "min_lines": 5,
                    },
                },
                {
                    "type": "input",
                    "block_id": "rich_text_max_block",
                    "label": {"type": "plain_text", "text": "max_lines: 16"},
                    "element": {
                        "type": "rich_text_input",
                        "action_id": "max_input",
                        "max_lines": 16,
                    },
                },
                {
                    "type": "input",
                    "block_id": "rich_text_both_block",
                    "label": {"type": "plain_text", "text": "min_lines: 3, max_lines: 20"},
                    "element": {
                        "type": "rich_text_input",
                        "action_id": "both_input",
                        "min_lines": 3,
                        "max_lines": 20,
                    },
                },
            ],
        },
    )


if __name__ == "__main__":
    SocketModeHandler(app, os.environ.get("SLACK_APP_TOKEN")).start()

Category

  • slack_sdk.models (UI component builders)
  • tests/integration_tests (Automated tests for this library)

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.17%. Comparing base (176b6cb) to head (994f30b).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1925      +/-   ##
==========================================
+ Coverage   84.14%   84.17%   +0.03%     
==========================================
  Files         118      118              
  Lines       13423    13425       +2     
==========================================
+ Hits        11295    11301       +6     
+ Misses       2128     2124       -4     

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

@srtaalej srtaalej self-assigned this Jul 29, 2026
@srtaalej srtaalej added enhancement M-T: A feature request for new functionality semver:minor labels Jul 29, 2026
@srtaalej
srtaalej marked this pull request as ready for review July 29, 2026 17:48
@srtaalej
srtaalej requested a review from a team as a code owner July 29, 2026 17:48

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙏 Awesome to find these options supported as expected arguments! LGTM!

@srtaalej
srtaalej merged commit 79c528e into main Jul 29, 2026
18 checks passed
@srtaalej
srtaalej deleted the feat/rich-text-input-min-max-lines branch July 29, 2026 18:26
@zimeg zimeg added this to the 3.44.0 milestone Jul 29, 2026
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 semver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants