Skip to content

fix(simple-data-table): SLDS 2 isHeadless and rounded table corners - #3365

Merged
interactivellama merged 2 commits into
chore/slds-linterfrom
fix/slds2-sdt-rounded-corners
Nov 24, 2026
Merged

interactivellama merged 2 commits into
chore/slds-linterfrom
fix/slds2-sdt-rounded-corners

Conversation

@interactivellama

Copy link
Copy Markdown
Contributor

Fixes #

Additional description

Two SLDS 2 fixes for SimpleDataTable's bordered table.

1. isHeadless stops adding slds-table_header-hidden (b614166)

SLDS 2 doesn't ship slds-table_header-hidden. In SLDS 1 the class only removed the table's top border. The thead is hidden by slds-assistive-text, which still works in SLDS 2 and keeps the column headers in the accessibility tree. The top border stays, because SLDS 2 draws a bordered table as a rounded box and removing it would leave the top corners open.

2. Cell backgrounds fit the rounded table corners (957246d)

Root cause: SLDS 2 (2.264.1) rounds .slds-table_bordered with --_slds-c-datatable-radius-border (8px in Cosmos, 0 in Lightning Blue) but doesn't round or clip its cells. Header cells and selected or hovered body cells paint square backgrounds that stick out past the rounded border.

Fix: the four corner cells get border-*-radius: inherit, using logical properties so RTL works. The thead, tbody and corner rows pass the radius down to them. With a hidden header, the first body row takes the top corners. With no body rows, the header row takes all four. SLDS 2 has no class or hook for corner cells, and this repo has no DSR stylesheet, so the styles are inline.

  • The table isn't clipped with overflow: hidden, because that would also clip the row-action menus.
  • inherit follows whatever radius the table ends up with. slds-table_header-fixed sets it to 0, so fixed-header cells stay square, and Lightning Blue stays square too.

Regression tests: browser tests against the SLDS 2 stylesheet cover both changes. Story snapshots are updated.

Checked in Storybook with Cosmos unless noted:

  • advanced-single-select-fixed-layout: select the last row. The bottom-left selection cell and the bottom-right row-action cell follow the 8px corner. Without the fix, the square blue background sticks out.
  • basic-fluid-layout-default: the header corners are rounded.
  • basic-fluid-layout-headless: the first body row takes the top corners.
  • fixed-header-story: unchanged.
  • Lightning Blue: every corner is 0.
  • RTL: the corners flip correctly.

Not checked: the stacked (slds-max-medium-table_stacked) layout on narrow screens.


CONTRIBUTOR checklist (do not remove)

Please complete for every pull request.

Green gate — all of these must pass locally (CI runs the same):

  • npm run lint passes with 0 errors and 0 warnings (npm run lint:fix to auto-fix).
  • npm run typecheck is clean (tsc --noEmit).
  • npm test -- --run passes — this runs both Vitest projects (jsdom unit + real-browser browser) and the story HTML snapshots. If you changed rendered markup on purpose, update snapshots with npm test -- --run -u and review the diff.
  • npm run build succeeds (type-check + Vite library build + .d.ts + entry shims).

Behavior & docs:

  • First-time contributors: sign the CLA (a bot will comment with instructions).
  • Added/updated Vitest + React Testing Library tests for the change (template: components/button/__tests__). New props and bug fixes should get a regression test. Tests that genuinely need a real browser (focus traversal, layout/measurement, canvas) go in a *.browser.test.jsx file (the browser project); everything else is jsdom.
  • Reviewed the component's Storybook stories: npm run storybook → http://localhost:6007/. Confirm the story actually renders and behaves (deprecated Storyshots/Karma are gone; there is no separate browser-tests server).
  • Story/example code uses the component's real prop API (e.g. slots like content / visualPickerFigure, render props like renderItem, icon props, events), not assumptions — a common source of "component looks broken" reports has been stories authored against the wrong API. Cross-check against components/<name>/__examples__.
  • Storybook Accessibility (a11y) panel shows no new violations for the affected stories.
  • If you added or changed a type, remember runtime PropTypes were removed in the TS migration — types are the contract. Ship accurate .d.ts (they're generated by the build); JS consumers rely on them via editor type-acquisition.

REVIEWER checklist (do not remove)

  • CI is green (GitHub Actions CI workflow: lint, typecheck, test, build). Chromatic visual review, if configured, has been checked.
  • Change has adequate test coverage; bug fixes include a regression test.
  • Reviewed the affected Storybook stories and their a11y panels.
  • Rendered markup still conforms to SLDS — check the story HTML snapshot diff (components/__tests__/__snapshots__/story-snapshots.test.jsx.snap).
  • Public API / package surface: if exports changed, the deep-import contract still holds (@salesforce/design-system-react/components/<name> and nested paths resolve for ESM, CJS, and types). Removing/renaming a public component or export is a breaking change → feat!:/BREAKING CHANGE: and a major version bump.

…adless

SLDS 2 does not ship slds-table_header-hidden. In SLDS 1 the class only
removed the table's top border; the thead is hidden by slds-assistive-text,
which keeps the header in the accessibility tree and still works in SLDS 2.
SLDS 2 draws a bordered table as a rounded box, so the top border is kept:
removing it would leave the rounded top corners open. Add a browser
regression test against the SLDS 2 stylesheet.
…corners

SLDS 2 rounds slds-table_bordered (8px in Cosmos, 0 in Lightning Blue), but
the header cells and selected or hovered body cells paint square
backgrounds that poke out past the corners. Clipping the table would also
clip the row action menus, so the four corner cells take
border-*-radius: inherit, and the thead, tbody and corner rows pass the
radius down. With a hidden header the first body row takes the top
corners. The radius follows the theme, so Lightning Blue stays square.

Add browser regression tests against the SLDS 2 stylesheet.
@interactivellama interactivellama added this to the 11.0.0-rc.1 milestone Nov 23, 2026
@interactivellama
interactivellama changed the base branch from chore/release-11.0.0-rc.2 to chore/slds-linter November 23, 2026 23:51
@interactivellama
interactivellama force-pushed the fix/slds2-sdt-rounded-corners branch from 957246d to 1b67eaf Compare November 23, 2026 23:51
@interactivellama
interactivellama merged commit 8ab4044 into master Nov 24, 2026
7 checks passed
@interactivellama
interactivellama deleted the fix/slds2-sdt-rounded-corners branch November 24, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants