---
description: Exxat DS — split rows in DataTable (one record, grouped sub-rows in a column). When to use, a11y structure, sub-row limits, and the Leo loading split row.
alwaysApply: false
globs: 
  - components/catalog-live-previews.tsx
  - lib/design-system/component-docs/leo-generation.tsx
tags: [table, a11y, ux, leo]
seeAlso:
  - .cursor/rules/exxat-data-tables.mdc
  - .cursor/rules/exxat-table-column-cells.mdc
  - .cursor/rules/exxat-accessibility.mdc
  - lib/design-system/component-docs/leo-generation.tsx
---

# Exxat DS — Split rows

A **split row** is one record (`<tr>`) whose columns hold one value (Learner, Site) while a **split column** stacks several grouped sub-rows inside the same row (Sessions). Declared with `ColumnDef.split = { items, cell?, maxVisible? }`.

## UX — MUST

1. **True one-to-many only.** Use split when a record owns several children that would otherwise force the parent fields to repeat (one learner, three sessions). For unordered labels use `TagListCell`; for people use the avatar rail; for a single value use a normal cell.
2. **One record = one row.** Selection, open-row, row actions, bulk actions, and row preview act on the **whole record**. Never a checkbox, kebab, or click target per sub-row.
3. **At most four sub-rows visible** (`SPLIT_MAX_VISIBLE`, override with `maxVisible` ≤ 4). Beyond that the last sub-row reads **"+N more"**; the full list lives in the record's detail view, not in the table.
4. **At most two split columns per table**, adjacent, so their dividers line up. Split columns pad to the longest sibling's count.
5. **Fixed sub-row height (36px).** Parent cells stay single and vertically centred across the full row. Do not wrap text in a sub-row: truncate and expose the full text in the detail view.
6. **Sort and filter on the parent.** A split column is not sortable and not groupable (`Group by` is not offered). Filters match **any** sub-value.
7. **Sub-rows are content, not a second table.** No sub-headers, no per-sub-row status columns. If sub-rows need their own columns, use a detail view or a nested table on the record page.
8. **Keep the split column ≥ 200px.** Narrower, sub-rows truncate to nothing; hide the column instead.
9. **Copy** follows `exxat-copy-discipline` (sentence case, no em dashes). "+N more", never "…and N others".

## Accessibility — MUST (WCAG 2.1 AA)

1. **Structure (1.3.1).** A split cell renders as `<ul role="list">` with one `<li>` per sub-row. Padding sub-rows added only to align dividers are `aria-hidden`. The column header names **every** sub-row; do not add per-sub-row headers.
2. **Reading order (1.3.2).** Row-major: all cells of the record, split items in source order. Never reorder sub-rows visually.
3. **Grouping is structural, not visual only (1.4.1, 1.4.11).** Dividers between sub-rows are decorative hairlines. The list structure carries the grouping, so removing the line (forced-colors, high contrast) loses nothing.
4. **Interactive sub-rows (2.1.1, 2.4.4, 4.1.2).** Default is non-interactive. If a sub-row holds a link or button: one control per sub-row, an **accessible name that includes the record** ("Open Wed · Simulation lab, Aarav Mehta"), reachable in DOM order, and no nested interactive inside another.
5. **Target size (2.5.8).** Sub-row height is 36px, above the 24px floor; keep inline controls ≥ 24×24.
6. **Truncation (1.4.4, 1.4.10).** Truncated sub-row text must be fully available (tooltip on hover and focus, or the detail view). At 200% zoom and 320px reflow the table scrolls horizontally; sub-rows never overlap.
7. **Name, role, value for the row (4.1.2).** The `<tr>` keeps its single selection state and label (`getRowSelectionLabel`); do not expose sub-rows as separate rows or rowspans.

## Leo loading split row — MUST

1. **Match the shape of the result.** `LeoLoadingRowSpec.splitCount` equals the sub-row count the finished row will have. Unknown: use **2**.
2. **One status announcement per row.** The row's `<output>` announces state once. Sub-row skeleton bars are `aria-hidden`.
3. **Stop is per row** (icon-only `Button`, accessible name "Stop"), never per sub-row.
4. **Completed is a brand check with "Leo is done"**, then the real split row replaces the placeholder with the same sub-row count, so the layout does not jump.
5. **Single brand colour** (`LeoBrandBackdrop`); motion off under `prefers-reduced-motion`.

## MUST NOT

- Use `rowSpan` to fake a split row. It breaks sorting, selection, and screen-reader table navigation.
- Put more than four visible sub-rows, or sub-rows of different heights.
- Nest a split column inside a split sub-row.
- Use split to show unrelated lists side by side.

## Verify

- Catalog: **Row types** on `/design-os/design-system/data-table`, **Split rows** on `/design-os/design-system/leo-generation`.
- Axe: no `list`, `listitem`, or `aria-hidden-focus` violations on a table with split rows.
