LibreChat/packages/data-provider
Marco Beretta d8797b227c 🗂️ feat: Give the Table Theme Roles for Header Text, Row Rules and Density (#16489)
* feat: Give the Table Theme Roles for Header Text, Row Rules and Density

The shared table could not take Click UI's shape: its header had no fill of
its own, column names were fixed to text-secondary, rows had no rule and
cells were fixed at 1rem. The header now always carries surface-secondary,
which every consumer already painted, and three roles are added: a
table-header-text color that falls back to a theme's secondary text, a
tableCellSpaceY length that sets cell padding and header height, and a
tableRowStroke width that is 0px by default. Tailwind Merge learns the
new padding and height utilities so a caller's own padding still wins.

The ClickHouse theme sets Click UI's header title color, small-size cell
space and 1px row stroke, and the drift guard pins them.

* fix: Carry the Column-Header Role Into Both Data Tables

Both exported data tables set text-secondary on the header cell or its
label, which beat the new role, so a theme never reached their column
names; they now read table-header-text. The legacy table's row titles keep
text-secondary explicitly, since they are row data rendered through
TableHead. The token falls back to --text-secondary for a stylesheet that
predates it.

* refactor: Give TableHeader a filled Variant Instead of a Caller Override

* feat: Route the Data Tables Through Table Density and a Header Fill Role

The density role reached no real table: every data table passed its own
py-1 or py-2. TableCell and TableRowHeader gain compact and dense sizes,
and TableHead sm, compact and row sizes, all derived from the table cell
space (half and a quarter of it), so the three data tables now read the
role while drawing exactly what they drew before. The virtualized table's
rows default to 32px plus half the cell space, 40px as before.

The virtualized table's self-sticking header cells now paint a
table-header-fill role that defaults to each theme's dialog surface, so
Shared Links and Archived Chats look the same by default and take Click
UI's header fill under the ClickHouse theme.

ClickHouse's cell space becomes Click UI's md value, 1rem: its sizes halve
the same way, so the compact tables land on sm, 0.5rem, the size Click UI
tables default to.

* fix: Re-render Mounted Table Rows When the Themed Row Height Changes

The memoized row compared only its data, selection and cells version, so a
theme switch left mounted rows on their old inline height and the
virtualizer measured that stale geometry. It now compares the height too.

* fix: Size Both Virtualizers From the Themed Row Geometry

The legacy table estimated every row at a fixed 48px while its title cells
now follow the cell space, and the dense row budgeted 32px of content that
is really 2rem of controls. A useTableRowHeight hook gives both the dense
and the titled height from the root size, the cell space and the row rule,
48px and 40px as before, and the legacy virtualizer re-measures when it
changes.

* fix: Measure the Legacy Table's Rendered Rows

The legacy table can be given columns without a title, whose rows are
shorter than a titled row, so the estimate alone could not match them.
Each rendered row now reports its size to the virtualizer, and the titled
height is only the first guess for rows not yet rendered.

* test: Compare Archived Header Space Apart From the Theme's Text Line

ClickHouse now draws text-sm on its own 1.5 line height, so its header is
a pixel taller than the default while keeping the same cell space. Compare
the space around the text line instead of the whole header height.

* fix: Keep the Row Rule Inside the Titled Row Estimate

The title cell draws the rule as its own bottom border inside a fixed
border-box height, so adding the stroke again overestimated every
unmounted titled row by the stroke width. Only the content-sized dense
and compact rows grow by it.

* test: Read the Table Defaults From the Published Stock Stylesheet

The table roles' stock values and the no-rule stroke now live in the
package's defaults.css, which replaces controls.css, and the stock
palette counts the two new table color roles.

(cherry picked from commit cf33a478f2)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16489
2026-10-01 03:46:19 +00:00
..
react-query
specs 💬 refactor: ChatForm UI redesign with unified palette (#14473) 2026-10-01 03:46:18 +00:00
src 🗂️ feat: Give the Table Theme Roles for Header Text, Row Rules and Density (#16489) 2026-10-01 03:46:19 +00:00
.gitignore
babel.config.js
check_updates.sh
jest.config.js 🧵 ci: Keep a Floor of Two Jest Workers in CI (#15819) 2026-09-14 00:32:20 -04:00
package.json 🎁 chore: Bump Packages and Helm After Security Fixes (#16582) 2026-09-30 22:35:22 -04:00
server-rollup.config.js
tsconfig.build.json
tsconfig.json
tsconfig.spec.json
tsdown.config.mjs