bugfix(icon): keep IconWrapper circular under flex pressure (CUI-39) - #1183
Merged
Merged
Conversation
IconWrapper sets a fixed square width/height per size with a 1px border and no flex-shrink, so as a flex item under pressure it shrinks on the width axis only and the bordered circle deforms into an ellipse — visible on the ARTESCA certificates page header below ~700px. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Hello jeanmarcmilletscality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Contributor
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
sanassicisse
approved these changes
Aug 13, 2026
sanassicisse
left a comment
There was a problem hiding this comment.
LGTM, tried it in the storybook
Contributor
Author
|
/approve |
Contributor
|
I have successfully merged the changeset of this pull request
Please check the status of the associated issue CUI-39. Goodbye jeanmarcmilletscality. The following options are set: approve |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR — A wrapped
Iconno longer squashes into an ellipse when its flex container runs out of room.Context / Why
IconWrappersets a fixed rem square per size with a 1px border and noflex-shrink, so as a flex item under pressure the browser shrinks its width only and the bordered circle deforms. Visible on the ARTESCA certificates page header below ~700px. CUI-39🧩 Approach
flex-shrink: 0onIconWrapper. Verified in a real browser with a control, squeezing the container from 400px to 150px:IconWrapperflex-shrink: 0(this PR)flex-shrink: 1(before)The fix only prevents shrinking, so nothing that rendered correctly before can change — an already-square wrapper stays exactly as it was.
📷 Screenshots
🔍 Review focus
src/lib/components/icon/Icon.component.tsx › IconWrapper— one declaration. It can only stop the wrapper from shrinking below its fixed square; the trade-off is that a very narrow flex container now overflows rather than deforming the icon, which is the intended behaviour for a bordered circle.🧪 How to test
npm run storybook→ Components/Icon › Wrapped icon stays circular when squeezed.🚧 Follow-up
@scality/core-uiinartesca/@artesca/ui/package.jsondirectly (@artesca/uiis built in-repo — notintegrate-components, notsolutions/*/variable.mk), which unblocks the ARTESCA certificates responsive ticket.🔗 References
Stackseparator). Kept in a separate PR because it needs design sign-off; this one doesn't, so it can merge and release independently.What changed
src/lib/components/icon/Icon.component.tsx—flex-shrink: 0onIconWrapper, with a comment recording why (the width/height above it are a fixed square).stories/icon.stories.tsx— addsStaysCircularUnderFlexPressure, a resizable flex row so the regression is reproducible by hand.No API surface change: no prop added, removed or retyped.
npx tsc --noEmitclean; related Jest tests green (200 passed / 24 suites).