Skip to content

feat: Add fitHeight prop to action card and item card - #5233

Open
jperals wants to merge 4 commits into
mainfrom
dev-v3-jotresse-card-components-fit-height
Open

jperals wants to merge 4 commits into
mainfrom
dev-v3-jotresse-card-components-fit-height

Conversation

@jperals

@jperals jperals commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Description

Doc: xYEyp4yQGcBl

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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.

🟡 Changes recommended

ActionCard’s new fitHeight behavior lacks public-component tests, and both fit-height examples use fixed pixel gaps instead of shared spacing tokens.

2 open issues
What changed in this PR

Adds an optional fitHeight property to ActionCard and ItemCard so consumers can align card heights within a row, while preserving the existing Cards component behavior.

Changes:

  • Exposes fitHeight, defaulting to false, through both public components and their styles.
  • Replaces ItemCard’s internal fullHeight property and updates its caller and tests.
  • Adds layout demos and updates generated API documentation snapshots.
File Description
src/​item-card/​styles.scss Renames the height class to fit-height.
src/​item-card/​internal.tsx Applies the class through fitHeight.
src/​item-card/​internal-interfaces.ts Removes the internal-only fullHeight property.
src/​item-card/​interfaces.ts Declares and documents public fitHeight.
src/​item-card/​index.tsx Defaults, records, and forwards fitHeight.
src/​item-card/​__tests__/​card.test.tsx Tests public fitHeight class application.
src/​cards/​index.tsx Migrates the internal caller to fitHeight.
src/​action-card/​styles.scss Adds full-height styling.
src/​action-card/​internal.tsx Conditionally applies the height class.
src/​action-card/​interfaces.ts Declares and documents public fitHeight.
src/​action-card/​index.tsx Defaults, records, and forwards fitHeight.
src/​__tests__/​snapshot-tests/​__snapshots__/​documenter.test.ts.snap Records both new public API properties.
pages/​item-card/​fit-height.scss Styles the ItemCard layout demo.
pages/​item-card/​fit-height.page.tsx Demonstrates layouts with optional footers.
pages/​action-card/​fit-height.scss Styles the ActionCard layout demo.
pages/​action-card/​fit-height.page.tsx Demonstrates height alignment across layouts.

Review effort: Balanced

Comment thread pages/item-card/fit-height.scss Resolved
Comment thread src/action-card/internal.tsx Resolved
@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.86%. Comparing base (c8ca653) to head (fa8f053).
⚠️ Report is 35 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5233      +/-   ##
==========================================
+ Coverage   97.76%   97.86%   +0.10%     
==========================================
  Files        1003     1016      +13     
  Lines       32572    32850     +278     
  Branches    12110    12179      +69     
==========================================
+ Hits        31843    32149     +306     
- Misses        684      695      +11     
+ Partials       45        6      -39     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jperals
jperals marked this pull request as ready for review November 9, 2026 16:42
@jperals
jperals requested a review from a team as a code owner November 9, 2026 16:42
@jperals
jperals requested review from vikaskale2722 and removed request for a team November 9, 2026 16:42
@jperals jperals changed the title feat: Add fitHeight property to action card and item card feat: Add fitHeight prop to action card and item card Nov 9, 2026
*/
disableContentPaddings?: boolean;

/**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should add a note about scroll behavior, just to differentiate it from container's fitHeight

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added

*/
disableFooterPaddings?: boolean;

/**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should add a note about scroll behavior, just to differentiate it from container's fitHeight

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added

Comment thread src/item-card/__tests__/card.test.tsx Outdated
it.each([true])('applies full-height class when fullHeight=%s', fullHeight => {
const { itemCard } = renderInternalItemCard(<InternalItemCard fullHeight={fullHeight}>content</InternalItemCard>);
expect(itemCard.getElement()).toHaveClass(styles['full-height']);
describe('fitHeight', () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit : The fitHeight block sits inside describe('internal props') and renders via renderItemCard. It's a public prop now, so it should move out of that block.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for catching this. I removed the test, because I don't think it's really useful. Asserting the presence of a classname is testing internal implementation. This is better covered with visual regression tests. This PR adds the dev page and a later PR will provide the test definition (if both are added together the comparison with main fails).

This branch had an error being deployed

1 failed and 2 active deployments
allure-report — fa8f0538 Deployed Nov 11, 2026 by jperals via Visual regression / Deploy Allure Report / deploy #3274
dev-pages-react18 — fa8f0538 Deployed Nov 11, 2026 by jperals via deploy (React 18) / deploy #3274
dev-pages-react16 — fa8f0538 Deployed Nov 11, 2026 by jperals via deploy (React 16) / deploy #3274
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants