Skip to content

feat: Enabled support for more than 4 columns for key-value pair - #5081

Open
vikaskale2722 wants to merge 6 commits into
mainfrom
dev-v3-vgkale-key-value-pairs-more-columns
Open

vikaskale2722 wants to merge 6 commits into
mainfrom
dev-v3-vgkale-key-value-pairs-more-columns

Conversation

@vikaskale2722

@vikaskale2722 vikaskale2722 commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Description

The Key-Value component only supported 4 columns before this implementation. This PR enables support for more than 4 columns in the component. There was a default hard-coded MAX_COLUMN value defined as 4. We remove the hardcoded maximum default. Earlier, if the number of columns provided were > 4, a warning was published on the console that the maximum columns allowed are 4. This implementation removes the warning as well.

Related links, issue #62223

How has this been tested?

Unit test
Manual test
Dry Run Build : #8046485265

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.

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.75%. Comparing base (fef61f5) to head (e452f31).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5081      +/-   ##
==========================================
- Coverage   97.75%   97.75%   -0.01%     
==========================================
  Files        1003     1003              
  Lines       32539    32536       -3     
  Branches    12085    12084       -1     
==========================================
- Hits        31810    31807       -3     
  Misses        684      684              
  Partials       45       45              

☔ 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.

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.

Note

Copilot was unable to run its full agentic suite in this review.

Copilot review overview

3 open issues
What changed in this PR

Updates KeyValuePairs to support more columns (beyond the previous hard limit), adjusts documentation to reflect the new columns behavior, and updates tests and permutations accordingly.

Changes:

  • Removed the runtime warning and clamping logic that limited columns to 4.
  • Updated public props documentation for columns/minColumnWidth and refreshed generated docs snapshot.
  • Reworked tests and added new visual permutations for higher column counts.
File Description
src/​key-value-pairs/​internal.tsx Removes the 4-column cap/warn and passes columns directly to ColumnLayout; updates a11y-related comment.
src/​key-value-pairs/​interfaces.ts Updates API docs to state support up to 12 columns and describes responsive reduction behavior.
src/​key-value-pairs/​__tests__/​key-value-pairs.test.tsx Replaces warn-on-exceed tests with “no warn” assertions and adds layout assertions for several column counts.
src/​__tests__/​snapshot-tests/​__snapshots__/​documenter.test.ts.snap Updates generated docs snapshot to match new prop documentation.
pages/​key-value-pairs/​permutations.page.tsx Adds permutations covering 5–6 columns and different minColumnWidth values.

Review effort: Lite

Comment thread src/key-value-pairs/internal.tsx Resolved
Comment thread src/key-value-pairs/internal.tsx Resolved
variant="text-grid"
minColumnWidth={minColumnWidth}
>
<ColumnLayout __tagOverride="dl" columns={columns} variant="text-grid" minColumnWidth={minColumnWidth}>

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.

What if a consumer passes minColumnWidth={0}

@vikaskale2722 vikaskale2722 Oct 30, 2026 •

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.

It will internally use GridColumnLayout (instead of FlexibleColumnLayout which it uses with minColumnWidth) and beyond 4 columns it will cause unexpected behavior. But passing 0 as a input to the column width does not make sense.
Do you think we should add a guardrail?

This branch was successfully deployed

3 active deployments
dev-pages-react16 — e452f31d Deployed Oct 30, 2026 by vikaskale2722 via deploy (React 16) / deploy #3070
dev-pages-react18 — e452f31d Deployed Oct 30, 2026 by vikaskale2722 via deploy (React 18) / deploy #3070
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