Skip to content

Commit 7cf4476

Browse files
committed
Support custom MCP server icons
1 parent bcfb54a commit 7cf4476

File tree

19 files changed

+505
-36
lines changed

19 files changed

+505
-36
lines changed

openapi-config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ const config: ConfigFile = {
3535
})),
3636
filterEndpoints: [
3737
/About/,
38+
/Agentic/,
39+
/AI/,
3840
/Assets/,
3941
/Authentication/,
4042
/CodeAnalytics/,
4143
/Dashboard/,
44+
/Diagnostic/,
4245
/Environments/,
4346
/Errors/,
4447
/Graphs/,

package-lock.json

Lines changed: 40 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
"react": "^18.2.0",
137137
"react-cool-dimensions": "^3.0.1",
138138
"react-dom": "^18.2.0",
139+
"react-dropzone": "^14.3.8",
139140
"react-error-boundary": "^5.0.0",
140141
"react-helmet": "^6.1.0",
141142
"react-hook-form": "^7.48.2",

src/components/Agentic/IncidentDetails/AgentFlowChart/MCPServerIcon/index.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,24 @@ import { MCPLogoIcon } from "../../../../common/icons/24px/MCPLogoIcon";
33
import { KubernetesLogoIcon } from "../../../../common/icons/25px/KubernetesLogoIcon";
44
import { PostgresLogoIcon } from "../../../../common/icons/25px/PostgresLogoIcon";
55
import { GitHubLogoIcon } from "../../../../common/icons/28px/GitHubLogoIcon";
6+
import * as s from "./styles";
67
import type { MCPServerIconProps } from "./types";
78

89
export const DEFAULT_SIZE = 12; // in pixels
910

1011
export const MCPServerIcon = ({
11-
type,
12-
isCustom,
13-
isActive,
14-
size = DEFAULT_SIZE
12+
size = DEFAULT_SIZE,
13+
server
1514
}: MCPServerIconProps) => {
16-
if (isCustom) {
15+
if (server.icon) {
16+
return <s.CustomImage $size={size} src={server.icon.url} />;
17+
}
18+
19+
if (server.isEditable) {
1720
return <MCPLogoIcon size={size} color={"currentColor"} />;
1821
}
1922

20-
switch (type) {
23+
switch (server.name) {
2124
case "github":
2225
return <GitHubLogoIcon size={size} color={"currentColor"} />;
2326
case "postgres":
@@ -29,7 +32,7 @@ export const MCPServerIcon = ({
2932
<DigmaLogoThemeableIcon
3033
size={size}
3134
color={"currentColor"}
32-
themeKind={isActive ? "light" : "dark"}
35+
themeKind={server.active ? "light" : "dark"}
3336
/>
3437
);
3538
default:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import styled from "styled-components";
2+
import type { CustomImageProps } from "./types";
3+
4+
export const CustomImage = styled.img<CustomImageProps>`
5+
width: ${({ $size }) => $size}px;
6+
height: ${({ $size }) => $size}px;
7+
object-fit: contain;
8+
`;
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
import type { ExtendedAgentMCPServer } from "../types";
2+
13
export interface MCPServerIconProps {
2-
type: string;
3-
isActive?: boolean;
4-
isCustom?: boolean;
4+
server: ExtendedAgentMCPServer;
55
size?: number;
66
}
7+
8+
export interface CustomImageProps {
9+
$size: number;
10+
}

src/components/Agentic/IncidentDetails/AgentFlowChart/MCPServersContainer/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ export const MCPServersContainer = ({ servers }: MCPServersContainerProps) => {
2020
<Tooltip title={x.display_name} key={`${x.name}__${i}`}>
2121
<s.MCPServerBlock $isActive={x.active} $zoomLevel={viewport.zoom}>
2222
<MCPServerIcon
23-
type={x.name}
24-
isActive={x.active}
25-
isCustom={x.isEditable}
23+
server={x}
2624
size={DEFAULT_ICON_SIZE * viewport.zoom}
2725
/>
2826
</s.MCPServerBlock>

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,7 @@ export const MCPServersToolbar = ({
9999
<div>
100100
<Tooltip title={x.display_name}>
101101
<s.MCPServerIconContainer $isEditable={x.isEditable}>
102-
<MCPServerIcon
103-
type={x.name}
104-
isActive={x.active}
105-
size={17}
106-
isCustom={x.isEditable}
107-
/>
102+
<MCPServerIcon server={x} size={17} />
108103
</s.MCPServerIconContainer>
109104
</Tooltip>
110105
</div>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const MCPServerIconContainer = styled.div<MCPServerIconContainerProps>`
2222
display: flex;
2323
align-items: center;
2424
justify-content: center;
25-
cursor: ${({ $isEditable }) => ($isEditable ? "pointer" : "default")};
25+
cursor: ${({ $isEditable }) => ($isEditable ? "pointer" : "auto")};
2626
`;
2727

2828
export const KebabMenuButton = styled.button`

0 commit comments

Comments
 (0)