Skip to content

Commit 715e9a2

Browse files
zimegClaude
andcommitted
docs(block-kit): re-sync data_table javadoc to docs + node review
Mirror the reviewed node SDK PR (slackapi/node-slack-sdk#2638): - Correct the max row count: the model previously stated up to 100 data rows (101 including header); the reference documents 201 rows (200 data rows plus header). The 100 cap was page_size, not the row maximum. Drop the stale count from the javadoc rather than restate it. - Align each field's javadoc with the data-table-block reference Fields table verbatim (rows, caption, page_size, row_header_column_index). - Trim RawTextDataTableCell / RawNumberDataTableCell to the terse, docs-minimal descriptions (drop the invented sorting/formatting tails); document value and text per the docs. Ref: https://docs.slack.dev/reference/block-kit/blocks/data-table-block Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent a6cc250 commit 715e9a2

4 files changed

Lines changed: 20 additions & 22 deletions

File tree

‎slack-api-model/src/main/java/com/slack/api/model/block/DataTableBlock.java‎

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@
99
import java.util.List;
1010

1111
/**
12-
* Displays a sortable, paginated grid of tabular data.
13-
*
14-
* <p>Each row is a list of {@link DataTableCell cells}; a cell may be a
15-
* {@link RawTextDataTableCell} ({@code raw_text}), {@link RawNumberDataTableCell}
16-
* ({@code raw_number}), or a {@link RichTextBlock} ({@code rich_text}). The first
17-
* row is the header row; header cells cannot use {@code rich_text}. A data table
18-
* supports 1-20 columns and up to 100 data rows (101 rows including the header),
19-
* with all rows sharing the same column count.</p>
12+
* Displays rich tables that support pagination, sorting, filtering, and interactivity.
2013
*
2114
* @see <a href="https://docs.slack.dev/reference/block-kit/blocks/data-table-block">Data table block</a>
2215
*/
@@ -29,25 +22,24 @@ public class DataTableBlock implements LayoutBlock {
2922
private final String type = TYPE;
3023

3124
/**
32-
* The rows of the table. Each row is a list of cells. The first row is the header row.
33-
* Minimum 2 rows (header plus one data row); maximum 101 rows. Every row must contain
34-
* the same number of cells (1-20).
25+
* An array consisting of table rows.
3526
*/
3627
@Builder.Default
3728
private List<List<DataTableCell>> rows = new ArrayList<>();
3829

3930
/**
40-
* Required. The caption describing the table, used as the caption of the rendered HTML element.
31+
* A caption for the table; used as the value for the HTML caption element.
4132
*/
4233
private String caption;
4334

4435
/**
45-
* The number of rows shown per page. Valid range 1-100; defaults to 5 when omitted.
36+
* Number of rows per page. Min {@code 1}, Max {@code 100}. Defaults to {@code 5} if omitted.
4637
*/
4738
private Integer pageSize;
4839

4940
/**
50-
* Zero-based index of the column that identifies each row. Defaults to 0 when omitted.
41+
* The 0-based index of the column that uniquely identifies each row (the row header). This column
42+
* is treated as the row's primary identifier for screen readers. Defaults to {@code 0} if omitted.
5143
*/
5244
private Integer rowHeaderColumnIndex;
5345

‎slack-api-model/src/main/java/com/slack/api/model/block/DataTableCell.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
* <li>{@link com.slack.api.model.block.RichTextBlock RichTextBlock} ({@code rich_text})</li>
1010
* </ul>
1111
*
12-
* <p>Header cells (those in the first row) cannot use the {@code rich_text} type.</p>
13-
*
1412
* @see <a href="https://docs.slack.dev/reference/block-kit/blocks/data-table-block">Data table block</a>
1513
*/
1614
public interface DataTableCell {

‎slack-api-model/src/main/java/com/slack/api/model/block/RawNumberDataTableCell.java‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
import lombok.NoArgsConstructor;
77

88
/**
9-
* A {@code raw_number} cell within a {@link DataTableBlock}, holding a numeric value.
10-
* The {@code text} field carries the display representation of the value (for example a
11-
* formatted string) and must be at least one character long. Columns made up entirely of
12-
* {@code raw_number} cells are sorted numerically.
9+
* A {@code raw_number} cell within a {@link DataTableBlock}: an object containing a numeric value.
1310
*
1411
* @see <a href="https://docs.slack.dev/reference/block-kit/blocks/data-table-block">Data table block</a>
1512
*/
@@ -20,6 +17,14 @@
2017
public class RawNumberDataTableCell implements DataTableCell {
2118
public static final String TYPE = "raw_number";
2219
private final String type = TYPE;
20+
21+
/**
22+
* The numeric value.
23+
*/
2324
private Double value;
25+
26+
/**
27+
* The text used to display the value. The minimum length is 1 character.
28+
*/
2429
private String text;
2530
}

‎slack-api-model/src/main/java/com/slack/api/model/block/RawTextDataTableCell.java‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
import lombok.NoArgsConstructor;
77

88
/**
9-
* A {@code raw_text} cell within a {@link DataTableBlock}, holding unformatted plain text.
10-
* The {@code text} must be at least one character long.
9+
* A {@code raw_text} cell within a {@link DataTableBlock}: an object containing some text.
1110
*
1211
* @see <a href="https://docs.slack.dev/reference/block-kit/blocks/data-table-block">Data table block</a>
1312
*/
@@ -18,5 +17,9 @@
1817
public class RawTextDataTableCell implements DataTableCell {
1918
public static final String TYPE = "raw_text";
2019
private final String type = TYPE;
20+
21+
/**
22+
* The text for the block. The minimum length is 1 character.
23+
*/
2124
private String text;
2225
}

0 commit comments

Comments
 (0)