Skip to content

Conversation

@dhasilva
Copy link
Contributor

@dhasilva dhasilva commented Dec 3, 2025

What?

Closes #73727

Applies the dataviews-view-table__col-primary class to the first column when hasPrimaryColumn is false as fallback.

Why?

When there is no titleField all columns are spaced, leaving unintended gaps in the table as it is assumed that the title field will be there to expand.

How?

By applying the same class of the title field to the first column if there is no title field, guaranteeing there will always be an expanding column.

Testing Instructions

Easiest way is to use Storybook.

  1. Start Storybook with npm run storybook:dev (or, separately, npm run dev, wait until done and then storybook dev -c ./storybook -p 50240 --ci if there is any issue with spawning browsers)
  2. Go to Dataviews > Default
  3. Click on the gear icon to open the table options
  4. Remove "Title", "Image" and "Description"
  5. Check that spacing is correct

Testing Instructions for Keyboard

Screenshots or screencast

Before After
Screenshot from 2025-12-03 16-30-12 Screenshot from 2025-12-03 16-31-09

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dhasilva <[email protected]>
Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: rcrdortiz <[email protected]>
Co-authored-by: simison <[email protected]>
Co-authored-by: oandregal <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Dec 3, 2025
@github-actions
Copy link

github-actions bot commented Dec 3, 2025

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @dhasilva! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@dhasilva dhasilva changed the title Dataviews: Apply primary style to first column if there is no title field DataViews: Apply primary style to first column if there is no title field Dec 3, 2025
@oandregal oandregal added the [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond label Dec 4, 2025
@oandregal
Copy link
Member

cc @rcrdortiz in case you can help review.

@simison simison added the [Type] Bug An existing feature does not function as intended label Dec 4, 2025
Copy link
Contributor

@rcrdortiz rcrdortiz left a comment

Choose a reason for hiding this comment

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

Besides the classname rename mentioned, the changes work as expected.

Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@ntsekouras ntsekouras merged commit cd4fae7 into WordPress:trunk Dec 5, 2025
37 checks passed
@github-actions github-actions bot added this to the Gutenberg 22.3 milestone Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dataviews: Tables without a title field display big gap after checkbox

5 participants