feat: Use flexible layout for columns > 4 without minColumnWidth#4260
feat: Use flexible layout for columns > 4 without minColumnWidth#4260ekatza wants to merge 5 commits intocloudscape-design:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4260 +/- ##
==========================================
+ Coverage 97.35% 97.42% +0.06%
==========================================
Files 888 891 +3
Lines 26031 26099 +68
Branches 9411 9435 +24
==========================================
+ Hits 25343 25427 +84
- Misses 641 666 +25
+ Partials 47 6 -41 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
hey @ekatza, Thanks for opening the pull request and taking time to contribute! After taking a closer look and doing some research about how this is used by customers, we found out that there are quite a few teams who are using columns of more than 4 without specifying minColumnWidths. While your fix addresses the spacing issue, automatically switching to FlexibleColumnLayout would introduce unexpected visual changes to their existing implementations. And since there's a documented workaround (setting minColumnWidth when using more than 4 columns), we've decided not to move forward with this change to maintain backwards compatibility. We appreciate you bringing this to our attention. If you have any questions or want to discuss alternative approaches, feel free to reach out. |
Description
This change enables ColumnLayout to automatically use flexible layout when more than 4 columns are specified without an explicit
minColumnWidthprop. Previously, flexible layout was only used whenminColumnWidthwas set, limiting the component to 4 columns maximum in grid mode.The change modifies the condition in
src/column-layout/internal.tsxto useFlexibleColumnLayoutwhen eitherminColumnWidthis provided ORcolumns > 4.Related links, issue #, if available: AWSUI-61702
How has this been tested?
src/column-layout/__tests__/column-layout.test.tsxverifying that 5 columns render correctly withoutminColumnWidthsrc/column-layout/__tests__/with-css.test.tsxverifying flexible layout is used with 5 columnspages/column-layout/min-width.permutations.page.tsxfor visual validationTo validate manually:
/light/column-layout/min-width-permutationsReview checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
interfaces.tsto remove 4-column limitation and document behavior for 5+ columnsCONTRIBUTING.md. - Fully backward-compatible; only affects new use case (columns > 4 without minColumnWidth). Previous 5+ columns without minColumnWidth set was not supported.CONTRIBUTING.md. - Uses existing FlexibleColumnLayout implementationSecurity
checkSafeUrlfunction. - n/aTesting
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.