Skip to content

Commit 091be67

Browse files
Merge pull request #1471 from digma-ai/fix/mcps-layout
Fix MCP icons layout
2 parents 2fa7d22 + f5de176 commit 091be67

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

src/components/Agentic/common/AgentFlowChart/MCPServersContainer/styles.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,20 @@ const DEFAULT_MCP_SERVER_BLOCK_SIZE = 50; // in pixels
66

77
export const Container = styled.div<ContainerProps>`
88
display: flex;
9+
flex-wrap: wrap;
10+
justify-content: center;
911
gap: ${({ $zoomLevel }) =>
1012
$zoomLevel ? $zoomLevel * DEFAULT_GAP_SIZE : DEFAULT_GAP_SIZE}px;
13+
max-width: calc(
14+
3 *
15+
${({ $zoomLevel }) =>
16+
$zoomLevel
17+
? $zoomLevel * DEFAULT_MCP_SERVER_BLOCK_SIZE
18+
: DEFAULT_MCP_SERVER_BLOCK_SIZE}px +
19+
2 *
20+
${({ $zoomLevel }) =>
21+
$zoomLevel ? $zoomLevel * DEFAULT_GAP_SIZE : DEFAULT_GAP_SIZE}px
22+
);
1123
`;
1224

1325
export const MCPServerBlock = styled.div<MCPServerBlockProps>`

src/components/Agentic/common/AgentFlowChart/MCPServersToolbar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const MCPServersToolbar = ({
9999
<div>
100100
<Tooltip title={x.display_name}>
101101
<s.MCPServerIconContainer $isEditable={x.isEditable}>
102-
<MCPServerIcon server={x} size={17} />
102+
<MCPServerIcon server={x} size={s.MCP_SERVER_ICON_SIZE} />
103103
</s.MCPServerIconContainer>
104104
</Tooltip>
105105
</div>

src/components/Agentic/common/AgentFlowChart/MCPServersToolbar/styles.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import styled from "styled-components";
22
import type { ContainerProps, MCPServerIconContainerProps } from "./types";
33

4+
const GAP = 6; // in pixels
5+
export const MCP_SERVER_ICON_SIZE = 17; // in pixels
6+
47
export const Container = styled.div<ContainerProps>`
58
display: flex;
9+
flex-wrap: wrap;
610
gap: 6px;
711
align-items: center;
812
justify-content: center;
@@ -17,6 +21,14 @@ export const Container = styled.div<ContainerProps>`
1721
rgb(255 255 255 / 10%) 0%,
1822
rgb(255 255 255 / 0%) 100%
1923
);
24+
max-width: calc(
25+
3 *
26+
${({ $zoomLevel }) =>
27+
$zoomLevel
28+
? $zoomLevel * MCP_SERVER_ICON_SIZE
29+
: MCP_SERVER_ICON_SIZE}px +
30+
2 * ${({ $zoomLevel }) => ($zoomLevel ? $zoomLevel * GAP : GAP)}px
31+
);
2032
`;
2133

2234
export const MCPServerIconContainer = styled.div<MCPServerIconContainerProps>`

0 commit comments

Comments
 (0)