Skip to content

Commit 1c254ed

Browse files
victorchrollo14kof
andauthored
fix: modify ui to prevent social image name overflow in page settings. (#5088)
## Description fixes: #4953 aligned the name and other contents properly preventing long image names from overflowing out of view. ![Screenshot from 2025-04-04 09-25-03](https://github.com/user-attachments/assets/68cf34b4-74f7-4468-b132-e5fb1c6f2358) ![Screenshot from 2025-04-04 09-24-57](https://github.com/user-attachments/assets/885807e1-dae8-49e0-b1f0-144ad96a29f5) ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [x] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file --------- Co-authored-by: Oleg Isonen <[email protected]>
1 parent 925ea10 commit 1c254ed

File tree

1 file changed

+34
-21
lines changed

1 file changed

+34
-21
lines changed

apps/builder/app/builder/features/pages/image-info.tsx

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { IconButton, Text, Grid, theme } from "@webstudio-is/design-system";
1+
import {
2+
IconButton,
3+
Text,
4+
Grid,
5+
theme,
6+
Flex,
7+
} from "@webstudio-is/design-system";
28
import {
39
AspectRatioIcon,
410
TrashIcon,
@@ -15,7 +21,7 @@ type ImageInfoProps = {
1521

1622
export const ImageInfo = ({ asset, onDelete }: ImageInfoProps) => {
1723
return (
18-
<Grid gap={1} flow={"column"} align={"center"} justify={"start"}>
24+
<Grid gap={1} flow={"column"} align={"center"} justify={"between"}>
1925
<Grid
2026
gap={2}
2127
flow={"column"}
@@ -30,25 +36,32 @@ export const ImageInfo = ({ asset, onDelete }: ImageInfoProps) => {
3036
pr: theme.spacing[5],
3137
}}
3238
>
33-
<Grid flow={"column"} gap={1} align={"center"}>
34-
<ImageIcon />
35-
<Text truncate variant={"labelsTitleCase"}>
36-
{asset.name}
37-
</Text>
38-
</Grid>
39-
|
40-
<Grid flow={"column"} gap={1} align={"center"}>
41-
<DimensionsIcon />
42-
<Text variant={"labelsTitleCase"}>
43-
{asset.meta.width} x {asset.meta.height} Px
44-
</Text>
45-
</Grid>
46-
|
47-
<Grid flow={"column"} gap={1} align={"center"}>
48-
<AspectRatioIcon />
49-
<Text variant={"labelsTitleCase"}>
50-
{getFormattedAspectRatio(asset.meta)}
51-
</Text>
39+
<Grid
40+
columns={1}
41+
css={{ padding: theme.panel.padding, width: theme.spacing[34] }}
42+
gap={2}
43+
align={"center"}
44+
>
45+
<Grid flow={"column"} gap={1} align={"center"}>
46+
<ImageIcon />
47+
<Text truncate variant={"labelsTitleCase"}>
48+
{asset.name}
49+
</Text>
50+
</Grid>
51+
<Grid columns={2} gap={1} align={"center"}>
52+
<Flex gap={1}>
53+
<DimensionsIcon />
54+
<Text variant={"labelsTitleCase"}>
55+
{asset.meta.width} x {asset.meta.height} Px
56+
</Text>
57+
</Flex>
58+
<Flex gap={1}>
59+
<AspectRatioIcon />
60+
<Text variant={"labelsTitleCase"}>
61+
{getFormattedAspectRatio(asset.meta)}
62+
</Text>
63+
</Flex>
64+
</Grid>
5265
</Grid>
5366
</Grid>
5467
<IconButton onClick={onDelete}>

0 commit comments

Comments
 (0)