fix text overflowing issue in app nav user menu (#1136)

https://linear.app/clickhouse/issue/HDX-1800/emailname-text-overflows-app-nav
This commit is contained in:
Brandon Pereira 2025-09-04 09:36:55 -06:00 committed by GitHub
parent a714412dfc
commit 042e359547
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 48 additions and 18 deletions

View file

@ -0,0 +1,5 @@
---
"@hyperdx/app": patch
---
Resolved overflow issue and enhanced color contrast in nav bar profile section.

View file

@ -9,6 +9,7 @@ import {
Menu,
Paper,
Text,
Tooltip,
UnstyledButton,
} from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';
@ -75,6 +76,8 @@ export const AppNavUserMenu = ({
.map(name => name[0].toUpperCase())
.join('');
const displayName = IS_LOCAL_MODE ? 'Local mode' : userName;
return (
<Menu position="top-start" transitionProps={{ transition: 'fade-up' }}>
<Menu.Target>
@ -96,24 +99,46 @@ export const AppNavUserMenu = ({
</Avatar>
{!isCollapsed && (
<>
<div style={{ flex: 1 }}>
<Text size="xs" fw="bold" lh={1.1} c="gray.3">
{IS_LOCAL_MODE ? 'Local mode' : userName}
</Text>
<Text
size="xs"
c="dimmed"
style={{
fontSize: 11,
maxWidth: '100%',
overflow: 'hidden',
textOverflow: 'ellipsis',
maxHeight: 16,
}}
>
{teamName}
</Text>
</div>
<Tooltip
fz="xs"
color="gray"
ta="center"
label={
<>
<strong>{displayName}</strong>
<br />
{teamName}
</>
}
openDelay={250}
>
<div style={{ flex: 1, overflow: 'hidden' }}>
<Text
size="xs"
fw="bold"
lh={1.1}
style={{
maxWidth: '100%',
overflow: 'hidden',
textOverflow: 'ellipsis',
}}
>
{displayName}
</Text>
<Text
size="xs"
style={{
fontSize: 11,
maxWidth: '100%',
overflow: 'hidden',
textOverflow: 'ellipsis',
maxHeight: 16,
}}
>
{teamName}
</Text>
</div>
</Tooltip>
<Icon name="chevron-right" className="fs-8 text-slate-400" />
</>
)}