Skip to content

Commit d5af58c

Browse files
fix: wrap env data before truncating env name. (#9733)
Solves an issue where the new buttons would potentially obscure the entire name of the env: ![image](https://github.com/user-attachments/assets/0bb1e7e9-90da-414e-bd70-eef264ac1867) Now, instead of using grid and container queries to find the right point to break, we're using flex to always wrap before needing to truncate the environment name. The name will still truncate if necessary. Why didn't we do this originally? I ... couldn't think of a way to make flex work in a 2D layout, but the `width: 100%` property seems to do the trick 😄 ![image](https://github.com/user-attachments/assets/fa81bf5b-3be0-4afa-8fc3-7a5b5ffeeefc) PS: the buttons only stack when they have to. They stay single-line for as long as possible. (just in case you were wondering). <img width="711" alt="image" src="https://github.com/user-attachments/assets/a9f85118-5b72-4618-a91b-f05c9d520663" />
1 parent 8da5fe6 commit d5af58c

File tree

1 file changed

+3
-8
lines changed
  • frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentHeader

1 file changed

+3
-8
lines changed

frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentHeader/EnvironmentHeader.tsx

+3-8
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,19 @@ const StyledHeader = styled('header')(({ theme }) => ({
3737
color: theme.palette.text.primary,
3838
alignItems: 'center',
3939
minHeight: theme.spacing(8),
40-
containerType: 'inline-size',
4140
}));
4241

4342
const StyledHeaderTitle = styled('hgroup')(({ theme }) => ({
44-
display: 'grid',
45-
gridTemplateColumns: 'auto 1fr',
46-
flexDirection: 'column',
43+
display: 'flex',
44+
flexFlow: 'row wrap',
4745
flex: 1,
4846
columnGap: theme.spacing(1),
49-
'@container (max-width: 500px)': {
50-
gridTemplateColumns: '1fr',
51-
},
5247
}));
5348

5449
const StyledHeaderTitleLabel = styled('p')(({ theme }) => ({
50+
width: '100%',
5551
fontSize: theme.fontSizes.smallerBody,
5652
color: theme.palette.text.secondary,
57-
gridColumn: '1/-1',
5853
}));
5954

6055
const StyledTruncator = styled(Truncator)(({ theme }) => ({

0 commit comments

Comments
 (0)