Skip to content

Commit b858c87

Browse files
committed
chore: update McpStatusList
1 parent d68baf7 commit b858c87

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/ui/McpStatusList.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ function ServerDetailView({
321321

322322
const maxVisible = useMemo(() => {
323323
const reservedLines = 10; // header + title + stats + footer + borders
324-
const availableLines = Math.max(0, Math.min(rows, 28) - reservedLines);
324+
const availableLines = Math.max(0, Math.min(rows, 30) - reservedLines);
325325
return Math.max(1, availableLines);
326326
}, [rows]);
327327

@@ -344,8 +344,6 @@ function ServerDetailView({
344344
newStart = activeIndex - maxVisible + 1;
345345
}
346346

347-
console.log("maxVisible:", maxVisible);
348-
349347
// 限制在合法范围内
350348
newStart = Math.max(0, Math.min(newStart, Math.max(0, totalItems - maxVisible)));
351349

@@ -412,7 +410,7 @@ function ServerDetailView({
412410
{/* Header row */}
413411
<Box paddingX={1} gap={1}>
414412
<Text color={color}>{icon} </Text>
415-
<Text bold color="#229ac3">
413+
<Text bold color="#229ac3" wrap="truncate-end">
416414
{server.name}
417415
</Text>
418416
<Text dimColor>— Details</Text>
@@ -422,7 +420,7 @@ function ServerDetailView({
422420
</Box>
423421
{/* Server info */}
424422
<Box paddingX={1} marginLeft={3}>
425-
<Text>
423+
<Text wrap="truncate-end">
426424
{server.toolCount} tools, {server.promptCount} prompts, {server.resourceCount} resources
427425
</Text>
428426
</Box>
@@ -455,7 +453,7 @@ function ServerDetailView({
455453
visibleItems.map((item, idx) => {
456454
const actualIndex = visibleStart + idx;
457455
const isSelected = actualIndex === activeIndex;
458-
return <ItemRow key={`${item.type}-${item.name}`} item={item} selected={isSelected} />;
456+
return <ItemRow key={`${item.type}-${item.name}-${actualIndex}`} item={item} selected={isSelected} />;
459457
})
460458
)}
461459
</Box>
@@ -482,7 +480,7 @@ function ItemRow({ item, selected }: { item: { type: string; name: string }; sel
482480
const icon = item.type === "tool" ? "🔧" : item.type === "prompt" ? "📝" : "📦";
483481

484482
return (
485-
<Box height={1} flexDirection="row" flexGrow={1}>
483+
<Box height={1} flexDirection="row">
486484
<Text dimColor>{icon} </Text>
487485
<Text color={selected ? "#229ac3" : undefined} dimColor wrap="truncate-end">
488486
{item.name}

0 commit comments

Comments
 (0)