Skip to content

Commit 9f3c1c7

Browse files
authored
fix: resolve text overflow issues for workspace empty state (coder#14015)
1 parent 4eb67ad commit 9f3c1c7

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

site/src/pages/WorkspacesPage/WorkspacesEmpty.tsx

+26-7
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ export const WorkspacesEmpty = (props: {
9292
>
9393
{featuredTemplates?.map((t) => (
9494
<Link
95-
to={`/templates/${t.name}/workspace`}
9695
key={t.id}
96+
to={`/templates/${t.name}/workspace`}
9797
css={(theme) => ({
9898
width: "320px",
9999
padding: 16,
@@ -120,19 +120,38 @@ export const WorkspacesEmpty = (props: {
120120
{t.name}
121121
</Avatar>
122122
</div>
123-
<div>
124-
<h4 css={{ fontSize: 14, fontWeight: 600, margin: 0 }}>
125-
{t.display_name.length > 0 ? t.display_name : t.name}
123+
124+
<div css={{ width: "100%", minWidth: "0" }}>
125+
<h4
126+
css={{
127+
fontSize: 14,
128+
fontWeight: 600,
129+
margin: 0,
130+
overflow: "hidden",
131+
textOverflow: "ellipsis",
132+
whiteSpace: "nowrap",
133+
}}
134+
>
135+
{t.display_name || t.name}
126136
</h4>
127-
<span
137+
138+
<p
128139
css={(theme) => ({
129140
fontSize: 13,
130141
color: theme.palette.text.secondary,
131-
lineHeight: "0.5",
142+
lineHeight: "1.4",
143+
margin: 0,
144+
paddingTop: "4px",
145+
146+
// We've had users plug URLs directly into the
147+
// descriptions, when those URLS have no hyphens or other
148+
// easy semantic breakpoints. Need to set this to ensure
149+
// those URLs don't break outside their containing boxes
150+
wordBreak: "break-word",
132151
})}
133152
>
134153
{t.description}
135-
</span>
154+
</p>
136155
</div>
137156
</Link>
138157
))}

0 commit comments

Comments
 (0)