Skip to content

fix(Table): preserve widths when header is hidden - #1165

Open
fallintoplace wants to merge 5 commits into
ClickHouse:mainfrom
fallintoplace:fix/table-widths-without-header
Open

fix(Table): preserve widths when header is hidden#1165
fallintoplace wants to merge 5 commits into
ClickHouse:mainfrom
fallintoplace:fix/table-widths-without-header

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Why?

When showHeader={false}, the table used to remove <colgroup> together with <thead>. That dropped configured column widths even though column layout should not depend on whether the header is visible.

What changed

  • Keep the table column group mounted when showHeader={false}.
  • Preserve configured column widths without rendering the header.
  • Keep the existing width and resize resolution logic unchanged.
  • Added unit coverage for visible and hidden headers.
  • Updated the NoHeader visual snapshots.

Regression coverage

The NoHeader visual test uses 220px, 200px, and 180px columns inside a 400px container with scrolling enabled, so it checks the actual overflow layout too.

Checks

  • corepack yarn test --run
  • corepack yarn typecheck
  • corepack yarn lint:code
  • corepack yarn lint:css
  • corepack yarn build
  • Linux Playwright visual test for NoHeader

@changeset-bot

changeset-bot Bot commented Aug 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1169e8f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clickhouse/click-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@XOP
XOP requested review from ariser and vineethasok and a lite review from Copilot August 25, 2026 10:06
@XOP XOP added the bug Something isn't working label Aug 25, 2026

Copilot AI 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.

Pull request overview

Fixes Table layout so configured column widths remain applied even when showHeader={false}, by keeping the <colgroup> mounted independently of <thead>.

Changes:

  • Extracted <colgroup> rendering into a dedicated Colgroup component and render it unconditionally within the table.
  • Simplified Thead to only render header rows/cells (no longer responsible for <colgroup>).
  • Added unit tests verifying colgroup/col widths are preserved with both visible and hidden headers, plus a changeset entry.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.

File Description
src/components/Table/Table.tsx Keeps <colgroup> mounted regardless of header visibility to preserve column width behavior.
src/components/Table/Table.test.tsx Adds coverage ensuring configured widths are present when header is shown/hidden.
.changeset/fix-table-widths-without-header.md Declares a patch release note for the width preservation fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@XOP

XOP commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

@fallintoplace please rebase from main, this will allow to run VRT, thank you!

@XOP XOP added the on hold On hold until further notice, do not merge label Sep 7, 2026
@XOP

XOP commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

✅ Ready to be merged, but will be included in the next release after upcoming one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working on hold On hold until further notice, do not merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants