Skip to content

Commit e3708ca

Browse files
committed
fix: longer mcp errors to show in virtual file
1 parent 5502729 commit e3708ca

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

gui/src/components/mainInput/Lump/sections/mcp/MCPSection.tsx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { useAppDispatch, useAppSelector } from "../../../../../redux/hooks";
1414
import { updateConfig } from "../../../../../redux/slices/configSlice";
1515
import { fontSize } from "../../../../../util";
1616
import { ToolTip } from "../../../../gui/Tooltip";
17+
import { Button } from "../../../../ui";
1718
import EditBlockButton from "../../EditBlockButton";
1819
import { ExploreBlocksButton } from "../ExploreBlocksButton";
1920

@@ -68,9 +69,34 @@ function MCPServerPreview({ server, serverFromYaml }: MCPServerStatusProps) {
6869
className={`h-3 w-3 ${server.status === "error" ? "text-red-500" : "text-yellow-500"}`}
6970
data-tooltip-id={errorsTooltipId}
7071
/>
71-
<ToolTip id={errorsTooltipId} className="flex flex-col gap-0.5">
72+
<ToolTip
73+
clickable
74+
id={errorsTooltipId}
75+
delayHide={
76+
server.errors.some((error) => error.length > 150) ? 1500 : 0
77+
}
78+
className="flex flex-col gap-0.5"
79+
>
7280
{server.errors.map((error, idx) => (
73-
<code key={idx}>{error}</code>
81+
<span key={idx}>
82+
<code>
83+
{error.length > 150
84+
? error.substring(0, 150) + "..."
85+
: error}
86+
</code>
87+
{error.length > 150 && (
88+
<Button
89+
className="my-0"
90+
size="sm"
91+
variant="ghost"
92+
onClick={() => {
93+
ideMessenger.ide.showVirtualFile(server.name, error);
94+
}}
95+
>
96+
Know More
97+
</Button>
98+
)}
99+
</span>
74100
))}
75101
</ToolTip>
76102
</>

0 commit comments

Comments
 (0)