Skip to content

Commit 5e46b3d

Browse files
committed
fix: adjust word break behavior for project tooltip and popup (#502)
Not sure why I went with `break-all` when initially implementing, but `break-word` seems more appropriate and is consistent with what we do elsewhere.
1 parent bc513d5 commit 5e46b3d

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

src/renderer/src/components/error-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function ErrorDialog({ errorMessage, onClose, open }: Props) {
8888
variant="body2"
8989
fontFamily="monospace"
9090
whiteSpace="pre-wrap"
91-
sx={{ wordBreak: 'break-word' }}
91+
sx={{ overflowWrap: 'break-word' }}
9292
>
9393
{errorMessage}
9494
</Typography>

src/renderer/src/components/generic-route-error-component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function GenericRouteErrorComponent({ error }: ErrorComponentProps) {
4848
variant="body2"
4949
fontFamily="monospace"
5050
whiteSpace="pre-wrap"
51-
sx={{ wordBreak: 'break-word' }}
51+
sx={{ overflowWrap: 'break-word' }}
5252
>
5353
{error.toString()}
5454
</Typography>
@@ -70,7 +70,7 @@ export function GenericRouteErrorComponent({ error }: ErrorComponentProps) {
7070
variant="body2"
7171
fontFamily="monospace"
7272
whiteSpace="pre-wrap"
73-
sx={{ wordBreak: 'break-word' }}
73+
sx={{ overflowWrap: 'break-word' }}
7474
>
7575
{error.stack}
7676
</Typography>

src/renderer/src/components/generic-route-not-found-component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function GenericRouteNotFoundComponent({
4141
fontWeight={500}
4242
textAlign="center"
4343
whiteSpace="pre-wrap"
44-
sx={{ wordBreak: 'break-word' }}
44+
sx={{ overflowWrap: 'break-word' }}
4545
>
4646
{t(m.title)}
4747
</Typography>
@@ -50,7 +50,7 @@ export function GenericRouteNotFoundComponent({
5050
<Typography
5151
textAlign="center"
5252
whiteSpace="pre-wrap"
53-
sx={{ wordBreak: 'break-word' }}
53+
sx={{ overflowWrap: 'break-word' }}
5454
>
5555
{data.data.message}
5656
</Typography>

src/renderer/src/routes/app/projects/$projectId/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function ProjectInfoSection({ projectId }: { projectId: string }) {
176176
},
177177
}}
178178
>
179-
<Typography variant="button" sx={{ wordBreak: 'break-all' }}>
179+
<Typography variant="button" sx={{ overflowWrap: 'break-word' }}>
180180
{displayedName}
181181
</Typography>
182182
</ButtonBase>
@@ -210,13 +210,13 @@ function ProjectInfoSection({ projectId }: { projectId: string }) {
210210
<Typography
211211
variant="h1"
212212
fontWeight={500}
213-
sx={{ wordBreak: 'break-all' }}
213+
sx={{ overflowWrap: 'break-word' }}
214214
>
215215
{displayedName}
216216
</Typography>
217217

218218
{projectSettings.projectDescription ? (
219-
<Typography sx={{ wordBreak: 'break-all' }}>
219+
<Typography sx={{ overflowWrap: 'break-word' }}>
220220
{projectSettings.projectDescription}
221221
</Typography>
222222
) : null}

src/renderer/src/routes/app/projects/$projectId_/team/$deviceId.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,9 @@ function CollaboratorInfoContent({
301301
padding={10}
302302
justifyContent="center"
303303
gap={20}
304+
sx={{ overflowWrap: 'break-word' }}
304305
>
305-
<Stack
306-
direction="column"
307-
gap={4}
308-
alignItems="center"
309-
sx={{ overflowWrap: 'anywhere' }}
310-
>
306+
<Stack direction="column" gap={4} alignItems="center">
311307
<DeviceIcon deviceType={member.deviceType} size="60px" />
312308

313309
<Typography variant="h1" fontWeight={500} textAlign="center">
@@ -331,7 +327,11 @@ function CollaboratorInfoContent({
331327
</Stack>
332328

333329
<Stack direction="column" gap={4} alignItems="center">
334-
<Typography color="textSecondary" textAlign="center">
330+
<Typography
331+
color="textSecondary"
332+
textAlign="center"
333+
sx={{ overflowWrap: 'anywhere' }}
334+
>
335335
{truncatedDeviceId}
336336
</Typography>
337337

0 commit comments

Comments
 (0)