Skip to content

Conversation

@elazzabi
Copy link
Contributor

What?

This adds support for the isCollapsible field in the card layout. To keep backward compatibility, if the field isn't defined, it defaults to true.

Why?

Non-collapsible cards can be used to display important details or when only one card is present on a page.

Testing Instructions

  1. An example is added to the storybook

Screenshots or screencast

CleanShot 2025-10-21 at 16 54 29@2x

@elazzabi elazzabi self-assigned this Oct 21, 2025
@elazzabi elazzabi requested a review from oandregal as a code owner October 21, 2025 15:54
@github-actions
Copy link

github-actions bot commented Oct 21, 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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @dmallory42.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: dmallory42.

Co-authored-by: elazzabi <[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.

@elazzabi elazzabi added [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Package] DataViews /packages/dataviews [Type] Enhancement A suggestion for improvement. labels Oct 21, 2025
@github-actions
Copy link

github-actions bot commented Oct 21, 2025

Flaky tests detected in ca04f4b.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18871775254
📝 Reported issues:

label: 'Important information',
layout: {
type: 'card',
isCollapsible: false,
Copy link
Member

Choose a reason for hiding this comment

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

It'd be nice to have this as an argument to the story, like withHeader is, to act as an educational tool for readers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, I added it and removed this new card. Here's how it looks:

CleanShot.2025-10-23.at.11.45.09.mp4

@oandregal
Copy link
Member

oandregal commented Oct 22, 2025

I need to check the logic with a fresher brain, and can review later if nobody else beats me to it. But direction looks good.

@oandregal
Copy link
Member

@elazzabi the README (see card documentation) needs to be updated as well.

Copy link
Member

@oandregal oandregal left a comment

Choose a reason for hiding this comment

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

I've left two comments (README, and useCardHeader hook) I'd like us to address before merging, but this is good to go.

@elazzabi elazzabi merged commit 1da7b87 into trunk Oct 28, 2025
35 of 36 checks passed
@elazzabi elazzabi deleted the add/is-collapsible branch October 28, 2025 11:06
@github-actions github-actions bot added this to the Gutenberg 22.0 milestone Oct 28, 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 [Package] DataViews /packages/dataviews [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants