Skip to content

fix: resolve text overflow issues for workspace empty state #14015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions site/src/pages/WorkspacesPage/WorkspacesEmpty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export const WorkspacesEmpty = (props: {
>
{featuredTemplates?.map((t) => (
<Link
to={`/templates/${t.name}/workspace`}
key={t.id}
to={`/templates/${t.name}/workspace`}
css={(theme) => ({
width: "320px",
padding: 16,
Expand All @@ -120,19 +120,38 @@ export const WorkspacesEmpty = (props: {
{t.name}
</Avatar>
</div>
<div>
<h4 css={{ fontSize: 14, fontWeight: 600, margin: 0 }}>
{t.display_name.length > 0 ? t.display_name : t.name}

<div css={{ width: "100%", minWidth: "0" }}>
<h4
css={{
fontSize: 14,
fontWeight: 600,
margin: 0,
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
>
{t.display_name || t.name}
</h4>
<span

<p
css={(theme) => ({
fontSize: 13,
color: theme.palette.text.secondary,
lineHeight: "0.5",
lineHeight: "1.4",
margin: 0,
paddingTop: "4px",

// We've had users plug URLs directly into the
// descriptions, when those URLS have no hyphens or other
// easy semantic breakpoints. Need to set this to ensure
// those URLs don't break outside their containing boxes
wordBreak: "break-word",
})}
>
{t.description}
</span>
</p>
</div>
</Link>
))}
Expand Down
Loading