Skip to content

Commit d68baf7

Browse files
committed
refactor(ui): 优化 MCP 状态列表视图及界面细节调整
- 将 MCP 状态列表拆分为服务器列表和服务器详情两种视图 - 支持通过方向键分页和滚动,确保选中项始终可见 - 服务器详情视图新增工具、提示和资源的详细列表展示及导航支持 - 为启动状态服务器添加动态加载动画,提升交互体验 - 错误信息使用带红色边框的样式包裹,更加醒目 - 统一界面中选中项前缀符号由 "› " 改为 "> " - 修正 DropdownMenu 和 SlashCommandMenu 的注释与前缀符号 - 调整 SessionList 中选中标识符,保持样式一致 - 优化行宽计算逻辑,提升标签列自适应能力 - 改善布局间距和边框样式,增强视觉层次感
1 parent 40025e4 commit d68baf7

6 files changed

Lines changed: 380 additions & 122 deletions

File tree

src/ui/AskUserQuestionPrompt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export function AskUserQuestionPrompt({ questions, onSubmit, onCancel }: Props):
184184
return (
185185
<Box key={option.value} flexDirection="column">
186186
<Text color={isCursor ? "cyanBright" : undefined}>
187-
{isCursor ? " " : " "}
187+
{isCursor ? "> " : " "}
188188
{marker} <Text bold={isCursor}>{option.label}</Text>
189189
</Text>
190190
{option.isOther ? (

src/ui/DropdownMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const DropdownMenu = React.memo(function DropdownMenu({
8282
// 计算每个 item 实际需要的最大宽度
8383
const maxContentWidth = Math.max(
8484
...visibleItems.map((item) => {
85-
let width = 2; // prefix " " or " "
85+
let width = 2; // prefix "> " or " "
8686
if (item.selected !== undefined) {
8787
width += 2; // "● " or "○ "
8888
}
@@ -152,7 +152,7 @@ const DropdownMenu = React.memo(function DropdownMenu({
152152
<Box key={item.key} flexGrow={1} flexDirection="row" gap={2}>
153153
<Box width={labelColumnWidth} flexShrink={0}>
154154
<Text color={isActive ? activeColor : undefined} wrap="truncate-end">
155-
{isActive ? " " : " "}
155+
{isActive ? "> " : " "}
156156
{item.selected !== undefined ? (item.selected ? "●" : "○") : null} <Text bold>{item.label}</Text>
157157
{item.statusIndicator ? (
158158
<Text color={item.statusIndicator.color}> {item.statusIndicator.symbol}</Text>

0 commit comments

Comments
 (0)