fix(home): keep the delay chip inside the current node card for long node names (#8633)

The node row is a space-between flex row, but the name column had the
default min-width: auto and the name was not truncated. A long name with
no break opportunity (for example xxx@host:443) widened the column to the
full text, pushed the delay chip past the card edge and made the main
content area scroll horizontally on narrow windows.

Let the name column shrink, truncate the name with an ellipsis (the full
name is in the title tooltip), and keep the chip from shrinking.

Fixes #8589

Co-authored-by: toBerlinWay <toBerlinWay@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Murphy
2026-11-12 16:45:05 +00:00
committed by GitHub
co-authored by toBerlinWay Claude Opus 5.5
parent 03d5c3715f
commit c2e36ab733
2 changed files with 9 additions and 2 deletions
+1
View File
@@ -29,6 +29,7 @@
- 修复全局模式默认停在 `DIRECT` 或 `REJECT` 导致流量未经代理,现自动切换到第一个策略组
- 修复订阅中未加引号的 REALITY `short-id`(如 `1234e123`)被误读为数字,导致订阅无法启用
- 修复订阅中唯一的代理组名为 `GLOBAL` 或没有代理组时,规则模式下代理页面显示「未获取到代理信息」
- 修复窗口较窄时,首页「当前节点」卡片中过长的节点名把延迟标签挤出卡片
**🍎 macOS**
+8 -2
View File
@@ -1008,8 +1008,13 @@ export const CurrentProxyCard = () => {
border: `1px solid ${alpha(theme.palette.primary.main, 0.1)}`,
}}
>
<Box>
<Typography variant="body1" sx={{ fontWeight: 'medium' }}>
<Box sx={{ minWidth: 0, flex: 1 }}>
<Typography
variant="body1"
noWrap
title={currentProxy?.name}
sx={{ fontWeight: 'medium' }}
>
{currentProxy?.name ??
t('home.components.currentProxy.labels.noActiveNode')}
</Typography>
@@ -1063,6 +1068,7 @@ export const CurrentProxyCard = () => {
size="small"
label={delayManager.formatDelay(currentDelay)}
color={convertDelayColor(currentDelay)}
sx={{ flexShrink: 0, ml: 1 }}
/>
)}
</Box>