Skip to content

fix(Table): a truncating header carries no native title - #13109

Open
cixzhang wants to merge 5 commits into
mainfrom
fix/table-header-no-native-title-truncate
Open

cixzhang wants to merge 5 commits into
mainfrom
fix/table-header-no-native-title-truncate

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

User impact

An app that renders a Table with textOverflow="truncate" and plain string column headings gets a browser tooltip on each of those headings: hovering such a header cell shows the native title with the heading's text, whether or not the heading is cut. (A sortable header carries no native title: the sort control replaces its string content with a node.) An app that bans native tooltips (and asserts that no element carries title) cannot use plain string headings at all. After this change a truncating header carries no native title, so a mouse hover shows nothing, as the header cell's contract says.

Problem and solution fit

  • Why it happens: BaseTable's header renderer adds title={heading} to every header cell whose resolved content is a non-empty string, in every overflow mode. That is every header that is not sortable or otherwise given node content.
  • Why it harms the task: under truncate, the header cell's disclosure for a cut heading is a tooltip on keyboard focus only; the native title adds a second, hover-only disclosure that the contract rules out, and it shows on headings that are not cut.
  • Why that matters: apps that keep every hint in Astryx's own Tooltip cannot opt out, and mouse users get a hover disclosure the contract says a truncating header never shows.

The fix drops the native title only when the Table truncates. Headers that wrap keep it unchanged.

Expected behavior and authority

  • component:TableHeaderCell FR2: under truncate, when its column cuts the heading short, keyboard focus inside the cell (a sortable header's sort control) shows the full heading in a tooltip, and "a mouse or pen hover and a touch tap show nothing".
  • component:Text review checks: reject "a native title beside the truncation Tooltip".

No current record decides the native title on headings that wrap, so this change leaves it there.

Smallest restoration

BaseTable.tsx's headerTitleProp now also requires textOverflow !== 'truncate'. No new prop, no visual change, and no change to wrapping headers or to the keyboard-focus tooltip.

Evidence

  • Reproduction before the change: on main, TableHeaderCell.truncationTooltip.test.tsx "puts no native title on a string heading when it truncates" fails (the th carries title), and "shows nothing on a mouse hover, as before" fails on the native title it now also checks.
  • Result after the change: both pass.
  • Representative unchanged path: "keeps the native title on a string heading when it wraps" passes before and after; the keyboard-focus tooltip cases are unchanged.
  • Regression test or other mutation-sensitive proof: the two new assertions above fail if the title returns under truncate.

Scope

Components: Table

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • vitest run --project ui packages/core/src/Table: 937 tests in 50 files pass.
  • Core tsc, ESLint and Prettier on the changed files: clean.

Overlap checked: #13070 (a do-not-merge release check that re-runs main as a whole, not a change to merge; this PR is the one Table header title fix)

Under textOverflow truncate, a cut heading's only disclosure is the
keyboard-focus tooltip, and a mouse hover shows nothing. A native title is a
hover disclosure, so a truncating string header no longer renders one.
Headers that wrap keep it.
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 21, 2026 12:26pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 20, 2026
@astracat-bot

astracat-bot Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 21, 2026, 4:39 PM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 0618e3a

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 425a9ca

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Table 124.1 kB (+2 B) · 21.1 kB CSS (0) — ✗ · ✓ · —
TableBody 6.6 kB (0) · 3.3 kB CSS (0) — ✗ · ✓ · ✗
TableCell 106.2 kB (0) · 20.1 kB CSS (0) — ✗ · ✓ · ✓
8 more components
Component Size LoC Visual · A11y · RTL
TableFooter 3.5 kB (0) · 3.3 kB CSS (0) — ✗ · ✓ · ✗
TableHeader 3.5 kB (0) · 3.3 kB CSS (0) — ✗ · ✓ · ✗
TableHeaderCell 106.1 kB (0) · 20.0 kB CSS (0) — ✗ · ✓ · ✓
TableRow 7.2 kB (0) · 4.1 kB CSS (0) — ✗ · ✓ · ✗
TableSelectionToolbar 78.0 kB (0) · 14.5 kB CSS (0) — ✗ · ✓ · ✓
Markdown 208.5 kB (+10 B) · 23.4 kB CSS (0) — — · — · —
lab/Comments 388.3 kB (+3 B) · 2.5 kB CSS (0) — — · — · —
lab/CommentThread 381.2 kB (+2 B) · 2.4 kB CSS (0) — — · — · —
Visual changes: 2 snapshots in 1 component

A change is a question for the reviewer, not a failure.

Component · story Before After Diff
Table · Default (neutral, dark) · same image also changed on another pull request, not proven from main before frame after frame diff frame
Table · Default (neutral, light) · same image also changed on another pull request, not proven from main before frame after frame diff frame

Inheritance checked against the 9 newest reports of other pull requests.

Package size: @astryxdesign/core 7.95 MB packed (+160 B); no new dependencies.

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes for one fix to the description; the code change matches the header cell's contract and needs no change.

  • The User impact section says a cut sortable heading shows the browser's native tooltip on hover beside the keyboard-focus tooltip (repeated under "Why that matters"), and that string headings get a native tooltip on every heading, but on main a sortable header carries no title (the sort plugin replaces the header content with its sort button, so BaseTable never adds one): please replace that example with the case that does show both, a string heading that shares its cell with another keyboard control such as an inline filter, and limit "every heading" to headings that are not sortable.

The changeset is accurate as written. The two new assertions fail on main and pass on this branch, and the Table test suite passes.

Claims and files checked

Review mode: same-head; reason: none

  • Changeset: a truncating header no longer puts a native title on the header cell — verified (BaseTable.tsx:936-941, new test).
  • Changeset: a mouse hover therefore shows nothing — verified (extended hover test; real-browser probe shows no title and no tooltip on hover).
  • Changeset: a cut heading still shows in full on keyboard focus of a sortable header — verified (unchanged keyboard test passes).
  • Changeset: wrapping headers keep the native title — verified (new wrap test; existing default-mode title test).
  • Description: string headings get a native tooltip on every heading under truncate — false for sortable headings, which carry none on main.
  • Description: a cut sortable heading shows the native tooltip beside the keyboard-focus tooltip, and that duplicate is noise for mouse users — false; sortable headers have no title on main (useTableSortable.tsx:452-460).
  • Description: the title was added to every header whose resolved content is a non-empty string, in every mode — verified.
  • Description: the header contract allows no hover disclosure under truncate, and the title showed on headings that were not cut — verified against the contract and in a real browser.
  • Description: the fix drops the title only when truncating and leaves wrapping headers alone — verified.
  • Description: the quoted header-cell and Text contract lines — verified; no current record decides the title on wrapping headings — verified.
  • Description: no new prop, no visual change, no change to the keyboard tooltip — verified (no public API change; before and after frames are pixel-identical).
  • Description: both new assertions fail on main and pass after the change, and the wrap test passes on both — verified.
  • Description: 937 Table tests in 50 files pass — verified; ESLint and Prettier on the changed files are clean — verified; Core typecheck — verified.
  • Description: the overlapping pull request is a do-not-merge release check — verified.
  • packages/core/src/Table/BaseTable.tsx — clear.
  • packages/core/src/Table/TableHeaderCell.truncationTooltip.test.tsx — clear.
  • .changeset/table-header-no-native-title-truncate.md — clear.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 6e3fb84

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes for one fix to the description; the code change matches the header cell's contract and needs no change.

  • The User impact section says a cut sortable heading shows the browser's native tooltip on hover beside the keyboard-focus tooltip (repeated under "Why that matters"), and that string headings get a native tooltip on every heading, but on main a sortable header carries no title because the sort plugin replaces its content with the sort button: please replace that example with the case that does show both, a string heading that shares its cell with another keyboard control such as an inline filter, and limit "every heading" to headings that are not sortable.

The changeset is accurate as written. The two new title assertions fail on main and pass on this branch, and the Table test suite passes.

Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0): none.
  • Changeset: a truncating header no longer puts a native title on the header cell — verified (BaseTable.tsx:936-941, new truncate test).
  • Changeset: a mouse hover therefore shows nothing — verified (extended hover test).
  • Changeset: a cut heading still shows in full on keyboard focus of a sortable header — verified (unchanged keyboard test; TableHeaderCell.tsx:177-183, :227).
  • Changeset: wrapping headers keep the native title — verified (new wrap test).
  • Changeset: credits a contributor — verified (credit line present, as the changeset check requires).
  • Description: string headings get a native tooltip on every heading under truncate — false for sortable headings, which carry none on main.
  • Description: apps that ban native tooltips cannot keep the title off string headings — verified for headings that are not sortable.
  • Description: a cut sortable heading shows the native tooltip beside the keyboard-focus tooltip, and that duplicate is noise for mouse users — false; sortable headers have no title on main (useTableSortable.tsx:452-460).
  • Description: the title was added to every header whose resolved content is a non-empty string, in every mode — verified.
  • Description: the header contract allows no hover disclosure under truncate, and the title showed on headings that were not cut — verified.
  • Description: the quoted header-cell and Text contract lines — verified; no current record decides the title on wrapping headings — verified.
  • Description: the fix drops the title only when truncating and leaves wrapping headers alone; no new prop, no visual change, no change to the keyboard tooltip — verified.
  • Description: both new assertions fail on main and pass after the change, and the wrap test passes on both — verified.
  • Description: 937 Table tests in 50 files pass; Core typecheck, ESLint and Prettier on the changed files are clean — verified.
  • Description: the overlapping pull request is a do-not-merge release check — verified.
  • packages/core/src/Table/BaseTable.tsx — clear.
  • packages/core/src/Table/TableHeaderCell.truncationTooltip.test.tsx — clear.
  • .changeset/table-header-no-native-title-truncate.md — clear.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved: the guard restores the header cell's contract that a mouse hover on a truncating header shows nothing, and CI passes on this head.

The two new title assertions fail on main and pass on this branch, and wrapping headers and the keyboard-focus tooltip are unchanged. Nothing else is needed from you.

Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0): none.
  • Changeset: a truncating header no longer puts a native title on the header cell — verified (BaseTable.tsx:936-941; the new truncate test fails on main and passes here).
  • Changeset: a mouse hover therefore shows nothing — verified (extended hover test).
  • Changeset: a cut heading still shows in full on keyboard focus of a sortable header — verified (unchanged keyboard test; TableHeaderCell.tsx:177-182, :227).
  • Changeset: wrapping headers keep the native title — verified (new wrap test passes on main and here).
  • Changeset: credits a contributor — verified (credit line present; the changeset check passes).
  • Description: in a truncating Table, plain string headings show a native tooltip on hover whether or not they are cut — verified on main (BaseTable.tsx:933-936 there).
  • Description: a sortable header carries no native title because the sort control replaces its string content with a node — verified (useTableSortable.tsx:446-460).
  • Description: an app that bans native tooltips cannot use plain string headings on main — verified (the title is added in every overflow mode there).
  • Description: after the change a truncating header carries no title and a mouse hover shows nothing — verified (new and extended tests).
  • Description: the title went on every header whose resolved content is a non-empty string, which is every header that is not sortable or given node content — verified (BaseTable.tsx:932, :936-941).
  • Description: under truncate the header contract allows only the keyboard-focus disclosure, and the title also showed on headings that were not cut — verified against the header cell's contract.
  • Description: the fix drops the title only when the Table truncates and wrapping headers keep it — verified.
  • Description: the quoted header-cell and Text contract lines — verified; no current record decides the title on wrapping headings — verified.
  • Description: no new prop, no visual change, no change to wrapping headers or the keyboard-focus tooltip — verified (no export or prop change; pixel-identical hover frames).
  • Description: both new assertions fail on main and pass after the change, the wrap test passes on both, and the assertions fail if the title returns — verified (red-first run).
  • Description: 937 Table tests in 50 files pass; core typecheck, ESLint and Prettier on the changed files are clean — verified.
  • Description: the overlapping pull request is a do-not-merge release check — verified.
  • Description: one defect restored, no new public API, default or interaction model, and no internal context in public text — verified.
  • packages/core/src/Table/BaseTable.tsx — clear.
  • packages/core/src/Table/TableHeaderCell.truncationTooltip.test.tsx — clear.
  • .changeset/table-header-no-native-title-truncate.md — clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as draft November 21, 2026 03:31
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 53db1fb

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet because the pull request is a draft, and marking it ready for review starts it.

The guard restores the header cell's contract that a mouse hover on a truncating header shows nothing; the two new title assertions fail without the fix and pass with it, and wrapping headers and the keyboard-focus tooltip are unchanged. Nothing else is needed from you.

Claims and files checked

Review mode: same-head; reason: none

  • Changeset: a truncating header no longer puts a native title on the header cell — verified (BaseTable.tsx:936-941; the new truncate test fails without the fix and passes here).
  • Changeset: a mouse hover therefore shows nothing — verified (extended hover test).
  • Changeset: a cut heading still shows in full on keyboard focus of a sortable header — verified (unchanged keyboard test; TableHeaderCell.tsx:177-183, :227).
  • Changeset: wrapping headers keep the native title — verified (new wrap test passes with and without the fix).
  • Changeset: credits a contributor — verified (credit line present).
  • Description: in a truncating Table, plain string headings show a native tooltip on hover whether or not they are cut — verified on the base (BaseTable.tsx:932-935 there).
  • Description: a sortable header carries no native title because the sort control replaces its string content with a node — verified (useTableSortable.tsx:452-460).
  • Description: an app that bans native tooltips cannot use plain string headings before this change — verified (the title is added in every overflow mode on the base).
  • Description: the title went on every header whose resolved content is a non-empty string, which is every header that is not sortable or given node content — verified (BaseTable.tsx:932, :936-941).
  • Description: under truncate the header contract allows only the keyboard-focus disclosure, and the title also showed on headings that were not cut — verified against the header cell's contract.
  • Description: after the change a truncating header carries no title and a mouse hover shows nothing — verified (new and extended tests).
  • Description: the fix drops the title only when the Table truncates and wrapping headers keep it — verified.
  • Description: the quoted header-cell and Text contract lines — verified; no current record decides the title on wrapping headings — verified.
  • Description: no new prop, no visual change, no change to wrapping headers or the keyboard-focus tooltip — verified (no export or prop change; pixel-identical hover frames).
  • Description: both new assertions fail before the change and pass after it, the wrap test passes on both, and the assertions fail if the title returns — verified (red-first run).
  • Description: the Table tests pass, and core typecheck, ESLint and Prettier on the changed files are clean — verified (938 tests in 50 files pass at this head, one more than stated because the merge from the base branch brought one test; the lint and type checks were verified on the same patch).
  • Description: the overlapping pull request is a do-not-merge release check — verified.
  • Description: one defect restored, no new public API, default or interaction model, and no internal context in public text — verified.
  • packages/core/src/Table/BaseTable.tsx — clear.
  • packages/core/src/Table/TableHeaderCell.truncationTooltip.test.tsx — clear.
  • .changeset/table-header-no-native-title-truncate.md — clear.

Automated review (maintainer link)

@cixzhang cixzhang added ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) lane:3 Astryx fix-loop lane 3 owns this labels Nov 21, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec a985395

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: one UI test shard is still running on this head; every other CI check has passed.

The guard restores the header cell's contract that a mouse hover on a truncating header shows nothing; the two new title assertions fail without the fix and pass with it, and wrapping headers and the keyboard-focus tooltip are unchanged. Nothing else is needed from you.

Claims and files checked

Review mode: same-head; reason: none

  • Release note: a truncating header no longer puts a native title on the header cell — verified (BaseTable.tsx:936-941; the new truncate test fails without the fix and passes with it).
  • Release note: a mouse hover therefore shows nothing — verified (extended hover test, TableHeaderCell.truncationTooltip.test.tsx:161-176).
  • Release note: a cut heading still shows in full on keyboard focus of a sortable header — verified (unchanged keyboard test; TableHeaderCell.tsx:177-183, :227).
  • Release note: wrapping headers keep the native title — verified (new wrap test passes with and without the fix).
  • Release note: credits a contributor — verified (credit line present).
  • Description: in a truncating Table, plain string headings show a native tooltip on hover whether or not they are cut — verified on the base (the title was added in every overflow mode).
  • Description: a sortable header carries no native title because the sort control replaces its string content with a node — verified (useTableSortable.tsx:452-460).
  • Description: an app that bans native tooltips cannot use plain string headings before this change — verified (the title is added in every overflow mode on the base).
  • Description: the title went on every header whose resolved content is a non-empty string, which is every header that is not sortable or given node content — verified (BaseTable.tsx:932, :936-941).
  • Description: under truncate the header contract allows only the keyboard-focus disclosure, and the title also showed on headings that were not cut — verified against the header cell's contract.
  • Description: after the change a truncating header carries no title and a mouse hover shows nothing — verified (new and extended tests).
  • Description: the fix drops the title only when the Table truncates and wrapping headers keep it — verified (BaseTable.tsx:937).
  • Description: the quoted header-cell and Text contract lines — verified; no current record decides the title on wrapping headings — verified.
  • Description: no new prop, no visual change, no change to wrapping headers or the keyboard-focus tooltip — verified (no export or prop change; pixel-identical hover frames).
  • Description: both new assertions fail before the change and pass after it, the wrap test passes on both, and the assertions fail if the title returns — verified (red-first run on the same patch).
  • Description: the Table tests pass, and core typecheck, ESLint and Prettier on the changed files are clean — verified (938 tests in 50 files, one more than stated because a merge from the base branch brought one test; CI's typecheck and lint pass on this head).
  • Description: the overlapping pull request is a do-not-merge release check — verified.
  • Description: one defect restored, no new public API, default or interaction model, and no internal context in public text — verified.
  • packages/core/src/Table/BaseTable.tsx — clear.
  • packages/core/src/Table/TableHeaderCell.truncationTooltip.test.tsx — clear.
  • .changeset/table-header-no-native-title-truncate.md — clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 21, 2026 11:05
github-actions Bot added a commit that referenced this pull request Nov 21, 2026
@cixzhang
cixzhang marked this pull request as draft November 21, 2026 12:12
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 425a9ca

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: one UI test shard is still running on this head; every other CI check has passed, and the merge guard waits for the rest.

The guard restores the header cell's contract that a mouse hover on a truncating header shows nothing; the two new title assertions fail without the fix and pass with it, and wrapping headers and the keyboard-focus tooltip are unchanged. Nothing else is needed from you.

Claims and files checked

Review mode: same-head; reason: none

  • Release note: a truncating header no longer puts a native title on the header cell — verified (BaseTable.tsx:936-941; the new truncate test fails without the fix and passes with it).
  • Release note: a mouse hover therefore shows nothing — verified (extended hover test, TableHeaderCell.truncationTooltip.test.tsx:161-176).
  • Release note: a cut heading still shows in full on keyboard focus of a sortable header — verified (TableHeaderCell.tsx:177-183, :227; keyboard test at TableHeaderCell.truncationTooltip.test.tsx:192-210).
  • Release note: wrapping headers keep the native title — verified (the wrap test passes with and without the fix).
  • Release note: credits a contributor — verified (credit line present).
  • Description: in a truncating Table, plain string headings showed a native tooltip on hover whether or not they were cut — verified on the base (the title was added in every overflow mode).
  • Description: a sortable header carries no native title because the sort control replaces its string content with a node — verified (useTableSortable.tsx:452-460).
  • Description: an app that bans native tooltips could not use plain string headings before this change — verified (same base condition).
  • Description: the title went on every header whose resolved content is a non-empty string, which is every header that is not sortable or given node content — verified (BaseTable.tsx:932, :936-941).
  • Description: under truncate the header contract allows only the keyboard-focus disclosure, and the title also showed on headings that were not cut — verified against the header cell's contract.
  • Description: after the change a truncating header carries no title and a mouse hover shows nothing — verified (new and extended tests).
  • Description: the fix drops the title only when the Table truncates, and wrapping headers keep it — verified (BaseTable.tsx:937).
  • Description: the quoted header-cell and Text contract lines — verified; no current record decides the title on wrapping headings — verified.
  • Description: no new prop, no visual change, no change to wrapping headers or the keyboard-focus tooltip — verified (no export or prop change; pixel-identical hover frames; the visual check's Table difference comes from the base branch, in a story where the title is unchanged).
  • Description: both new assertions fail before the change and pass after it, the wrap test passes on both, and the assertions fail if the title returns — verified (red-first run on the same patch).
  • Description: the Table tests pass, and typecheck, ESLint and Prettier on the changed files are clean — verified (938 tests in 50 files on the same patch, one more than stated because an earlier merge brought one test; CI's typecheck and lint passed on this head).
  • Description: the overlapping pull request is a do-not-merge release check — verified.
  • Description: one defect restored, no new public API, default or interaction model, and no internal context in public text — verified.
  • packages/core/src/Table/BaseTable.tsx — clear.
  • packages/core/src/Table/TableHeaderCell.truncationTooltip.test.tsx — clear.
  • .changeset/table-header-no-native-title-truncate.md — clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 21, 2026 16:18
github-actions Bot added a commit that referenced this pull request Nov 21, 2026

This branch was successfully deployed

1 active deployment
Preview — 425a9ca5 Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot. lane:3 Astryx fix-loop lane 3 owns this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant