fix: truncate long MCP server names with tooltip on hover

- Add text truncation styles (overflow, text-overflow, white-space) to server name
- Wrap server name span in StandardTooltip to show full name on hover
- Add flexShrink: 0 to buttons container to prevent it from being pushed out

Fixes #11188
This commit is contained in:
Roo Code 2026-02-04 17:03:29 +00:00
parent 7f6272afb9
commit e989cc0358

View file

@ -267,24 +267,33 @@ const ServerRow = ({ server, alwaysAllowMcp }: { server: McpServer; alwaysAllowM
style={{ marginRight: "8px" }}
/>
)}
<span style={{ flex: 1 }}>
{server.name}
{server.source && (
<span
style={{
marginLeft: "8px",
padding: "1px 6px",
fontSize: "11px",
borderRadius: "4px",
background: "var(--vscode-badge-background)",
color: "var(--vscode-badge-foreground)",
}}>
{server.source}
</span>
)}
</span>
<StandardTooltip content={server.name}>
<span
style={{
flex: 1,
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
minWidth: 0,
}}>
{server.name}
{server.source && (
<span
style={{
marginLeft: "8px",
padding: "1px 6px",
fontSize: "11px",
borderRadius: "4px",
background: "var(--vscode-badge-background)",
color: "var(--vscode-badge-foreground)",
}}>
{server.source}
</span>
)}
</span>
</StandardTooltip>
<div
style={{ display: "flex", alignItems: "center", marginRight: "8px" }}
style={{ display: "flex", alignItems: "center", marginRight: "8px", flexShrink: 0 }}
onClick={(e) => e.stopPropagation()}>
<Button
variant="ghost"