← All proposals

Logs table with divider

A recipe: the PDS Logs Table pattern (Table with hasPanel, status-colored rows and the inline detail panel) with a LabeledDivider as a row.

Extends a PDS componentOpen in Storybook

proposals/LogsTableWithDivider/HANDOFF.md148 lines · View on GitHub

Handoff: Logs table with divider (recipe)

Rewritten 2026-11-20 against v2.0.0-beta.21 to the lessons template (docs/LESSONS.md, L1 to L11). The composition was checked against LogsTableWithDivider.stories.tsx, logs-table-divider.css and the package Table at beta.21. This is a recipe: sections that do not apply say "none, recipe". Nothing was checked by eye in a session and the a11y panel was not run.

What and why

A recipe, not a component: a story and Usage page that compose the published PDS Table (the Logs Table pattern) with a LabeledDivider as one row. In a runtime or edge log it marks a point in time (a day change) and lets the reader jump to another one, through the divider's time menu and date picker. PDS has the Logs Table pattern but no way to put a labeled break in it. The recipe has no API of its own, so there is nothing to port beyond the components it uses (below); the engineer copies the composition. The pattern's CSS is copied from the reference checkout because the published package does not ship it (checked: no pds-logs-table in the installed package's dist/css).

Recommendation (L10): do not ship this as a production pattern until Table has a separator row. The workaround below leaves a keyboard bug (see Accessibility). It is fine as a design example.

  • Figma / Jira: none. Source: Erika, 2026-10-16, "pull in the Logs Table PDS and add a divider there as an example".
  • Context: context.md

Exploration and decisions

  • Recipe, with the pattern copied in. The Logs Table is a pattern in the PDS source (src/patterns/tables/logs-table/), not a published component, so logs-table.css is copied from there. Checked with diff against the beta.21 reference: identical. The story is a trimmed copy of the pattern's Default story (8 entries, a shorter detail panel) plus one divider row.
  • The divider is a row, stretched across the cells. Table is data-driven and cannot span columns. Two tables would lose the sticky header, the scroll area and Prev/Next in the detail panel. So the divider is a row whose first cell holds the LabeledDivider and CSS stretches it across the row.
  • Newest first, as in the pattern, so entries above the divider are newer. The label shows the day the entries below belong to.
  • The divider is the time-jump selector, not the agentic divider (Erika, 2026-10-16). "Zappy engaged" belongs in the Event log with agent recipe. The agentic divider would work the same way in a row.

Full list and reasons: decisions.md.

API

None, recipe. What it composes and how (story: LogsTableWithDivider.stories.tsx):

  • Table (published) inside a div.pds-logs-table, with hasPanel, hasDesktopDetailPanel, aria-label, columns (Time, Level, Environment, Message), detailPanelTitle, maxHeight and minHeight of 30rem, getRowId, prevDetailPanelRowLabel, nextDetailPanelRowLabel, renderDetailPanel and rowData. hasMobileCards is not set (its default is false), so the story never shows cards. No column is sortable.
  • getRowClassName gives status rows pds-table__row--critical or pds-table__row--warning, and the divider row logs-table-example__divider-row.
  • The divider row is one more entry in rowData, placed between the newer and older entries, with id divider-time-jump and status: 'divider'. Its timestamp cell holds a LabeledDivider with size='xs', label (the day) and an action slot (updated 2026-11-20) holding a MenuButton (a "Jump to..." heading, then Today, Yesterday, Last week, Last month, The very beginning) and a date picker in a modal, from the story-only helper _story-helpers/LabeledDividerSelector; the Labeled Divider no longer has menuItems, datePicker or id props. The other cells are empty strings.
  • renderDetailPanel returns null for the divider row, and a dl (Timestamp, Level, Source) for entries.
  • Event handling: the divider gets onClick and onKeyDown handlers that call stopPropagation, so using the menu or the date picker modal does not open the row's detail panel. The menu and modal render in portals, but their events still bubble through the React tree.
  • CSS (logs-table-divider.css, story-only): the divider row gets position: relative and pointer-events: none; its cells get padding-block: var(--pds-spacing-xl); the divider in the first cell is position: absolute, full row width (inset-inline: 0), vertically centered (inset-block-start: 50% with translateY(-50%)), width: auto, with pointer-events: auto.

What the screen owns: the entries and their statuses, the divider's position (which day it marks), its label, the menu items and what each does (the callbacks and onChange are empty in the story), the column set, the detail panel content, and any filtering or loading that follows a jump.

Story-only (L9, the engineer drops or rewrites): LogEntry and sampleLogs, toRowData, stopRowEvents, timeMenuItems with empty callbacks, the LabeledDividerSelector helper, dividerRow, the DIVIDER_ID constant, logs-table-divider.css, and all sample text.

Tokens used

Story-only CSS; nothing here ships in the package. logs-table-divider.css itself uses only --pds-spacing-xl. The rest come from the copied logs-table.css. Full list from the pattern CSS and the divider CSS as they are now:

  • --pds-border-width-default
  • --pds-color-badge-critical-muted-background
  • --pds-color-badge-critical-muted-foreground
  • --pds-color-border-default
  • --pds-color-foreground-default
  • --pds-color-foreground-default-secondary
  • --pds-color-status-critical-foreground
  • --pds-color-status-warning-foreground
  • --pds-spacing-2xs
  • --pds-spacing-3xs
  • --pds-spacing-4xs
  • --pds-spacing-m
  • --pds-spacing-xl
  • --pds-spacing-xs
  • --pds-typography-fw-medium
  • --pds-typography-fw-semibold
  • --pds-typography-size-s
  • --pds-typography-size-xs

No custom CSS variables and no raw values kept. The previous handoff said npm run check:tokens reports 0 problems; that was not re-run for this rewrite.

Impact

From impact.md: nothing reaches existing components. Everything it adds is scoped to its own classes, it is opt-in, and it redefines no --pds-* token. No other proposal imports or uses it. It depends on the proposals below, and changes to them change what the story shows.

Reused vs net-new

  • Reused: the published Table (hasPanel, hasDesktopDetailPanel, getRowClassName, renderDetailPanel, Prev/Next labels: all exist at beta.21) and the LabeledDivider proposal (../LabeledDivider/). Through LabeledDivider it also depends on the Button, Icon Button, Menu Button, Icon and Spinner proposals and Agent Avatar (from node scripts/port-order.mjs --needs=LogsTableWithDivider); whether AgentAvatar (shipped in beta.18) still needs a port was not re-checked here.
  • Net-new: no components, props or custom variables. Classes copied from the PDS Logs Table pattern (not in the published package): .pds-logs-table (with __footer, __footer-controls) and .pds-logs-detail__section (with __badge, __label, __value, __value--critical, __value--warning). Story-only: .logs-table-example__divider-row. Details in custom.md.
  • Depends on LabeledDivider (updated 2026-11-20). The Labeled Divider no longer needs the Agentic Menu Button (the selector is now an action slot with a MenuButton), so only Icon is ahead of it in docs/PORT-ORDER.md. Check the ready tags and docs/PORT-ORDER.md before starting.

Accessibility

What the code does (read from the files; not tested with a screen reader):

  • The Table has an aria-label ("Application logs"), and the Prev/Next detail panel buttons carry labels (prevDetailPanelRowLabel, nextDetailPanelRowLabel). The divider's menu and date picker have their own labels (menuLabel, modalTitle, pickerLabel). Keyboard and focus otherwise come from Table and LabeledDivider.
  • Known gap (a real keyboard bug). Table.tsx gives every inspectable row tabIndex=0 and an Enter and Space handler (tabIndex={isInspectable ? 0 : undefined}). The divider row is still in the row list, so it can take keyboard focus, Enter or Space opens an empty detail panel (the story returns null for it), and Prev/Next steps onto it. The divider stops its own clicks and keys from reaching the row, and the row has pointer-events: none (so a mouse cannot reach it), but the keyboard still can. The row also carries aria-selected.
  • Screen reader semantics of the divider row inside the table (an empty row of cells with a control in the first cell): not checked.
  • Mobile cards: hasMobileCards is off in the story, so the story never shows them. With it on, the divider row has no card layout (not handled, not checked).
  • a11y panel: not run. Light and dark: not checked. Contrast: not checked.

Decisions and open questions

Each carries a recommended answer (the designer decides; the first one is for the Table owners).

  • Does Table need a first-class separator row (spans the columns, not inspectable, skipped by Prev/Next, sort and selection)? Owner: Table maintainers. Checked at beta.21: Table.tsx has no colSpan, separator or non-inspectable row API, and CHANGELOG.mdx has no such entry. Recommendation: add a row type for it (for example a rowType='separator', or a callback such as isRowInspectable(row)), which also fixes the focus gap. Until then, call the recipe an example, not a pattern to ship.
  • Should the divider show a time (for example the day)? The label is the screen's. Recommendation: yes, show the day, as the story does ("Jun 29, 2026"); the screen sets it.
  • LabeledDivider has to land with or before this recipe. Recommendation: do not start this port until LabeledDivider ships.

Extension or new component

None, recipe: it adds no component and no prop to Table. It is the existing Logs Table pattern plus one row with a divider (L1 holds: the pattern's CSS is untouched, byte-identical to the source). The one thing that would be an extension is the Table separator row above.

Footprint

From logs-table-divider.css (not checked by eye):

  • The divider is taken out of the table layout: position: absolute with inset-inline: 0 inside a position: relative row. It spans the full row width (edge to edge, over every cell) and is vertically centered on 50% of the row. The row's height comes only from the first cell's padding-block: var(--pds-spacing-xl), so a divider taller than that overflows the row.
  • It depends on the row being the nearest positioned ancestor. The Table's scroll area sets overflow (table.css), so the divider is clipped at it; a td made position: relative by other CSS would shrink it to one cell.
  • With the detail panel open, the row narrows with the table; whether the divider keeps up was not checked.
  • pointer-events: none on the row means the whole row ignores the mouse except the divider, which sets pointer-events: auto.
  • Mobile card view (hasMobileCards): not handled.
  • Sticky header: the row scrolls under it like any row (not checked).

Dark mode and per-size values

None of its own, recipe. Single size (LabeledDivider size='xs', padding --pds-spacing-xl). No per-theme override in logs-table-divider.css. The status row colors and the divider come from tokens and components elsewhere; dark mode was not checked.

Part Value Light and dark
Divider row cell padding --pds-spacing-xl (block) no per-theme override
Divider size xs (a prop, single size) set by LabeledDivider
Divider width full row, inset-inline: 0 single size
Status rows (critical, warning) pds-table__row--* from the package package tokens

Expect to change

Choices that break or bend a toolkit convention, with a recommended answer:

  1. A row that is not a data row (L2, L10). Table is data-driven; the recipe adds a fake data entry (status: 'divider', empty strings) and branches on it in getRowClassName and renderDetailPanel. Recommendation: replace with the separator row in Table (see open question 1) and delete logs-table-divider.css, stopRowEvents and the DIVIDER_ID checks.
  2. Absolute positioning on a tr (L6). The CSS depends on position: absolute and pointer-events: none. Recommendation: treat as a stopgap; the engineer may prefer a different approach in Table.
  3. stopPropagation handlers on the divider. Needed only because the row is clickable. Recommendation: drop with the workaround.
  4. A page example rather than API. If the engineer prefers no Recipe page for a workaround, keep the story out of the library and only note the Table gap. Recommendation: keep it as a design example until the Table change lands.

Target-version check

Checked 2026-11-20 against .pds-reference/src at v2.0.0-beta.21 and the installed package (2.0.0-beta.21).

Item Exists at beta.21?
Logs Table pattern CSS (src/patterns/tables/logs-table/logs-table.css) yes in the source; identical to logs-table.css here. Not in the published package CSS
Table props hasPanel, hasDesktopDetailPanel, getRowClassName, getRowId, renderDetailPanel, detailPanelTitle, maxHeight, minHeight, prevDetailPanelRowLabel, nextDetailPanelRowLabel, rowData, columns yes
A Table separator row, colSpan or non-inspectable row API no (none in Table.tsx or CHANGELOG.mdx)
LabeledDivider no
pds-table__row--critical and --warning classes yes, defined in Table's table.css
hasMobileCards default false

Port notes

  • Nothing to generate and nothing to copy into pds-toolkit-react for the recipe itself, and nothing can be ported until LabeledDivider and its dependencies land. The story and Usage page then stay as documentation.
  • logs-table.css already lives in PDS as the Logs Table pattern; logs-table-divider.css is the only recipe-specific CSS and exists to stretch the divider across the row. A separator row in Table would replace it.
  • Raise the Table separator row with the Table owners (open question 1) before anything else.

Preview

npm run storybook, then Recipes/Logs table with divider (story Default). Figma: none.