diff --git a/src/features/agents/BuiltinAgents.module.css b/src/features/agents/BuiltinAgents.module.css index 709b90229..9744470fc 100644 --- a/src/features/agents/BuiltinAgents.module.css +++ b/src/features/agents/BuiltinAgents.module.css @@ -1,6 +1,6 @@ .split { display: flex; - flex: 1; + flex: none; min-height: 320px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); @@ -19,6 +19,20 @@ min-width: 0; padding: 0 10px; } +.agentMissing .agentName { + color: var(--fg-muted); +} +.agentMissing svg { + opacity: 0.6; +} +.tag { + flex: none; + color: var(--fg-subtle); + font-size: var(--fs-small); +} +.tagCustom { + color: var(--accent); +} .agentName { flex: 1; overflow: hidden; @@ -41,19 +55,43 @@ margin: 0; font-size: var(--fs-input-large); } -.launch { - display: block; - margin: 8px 0 0; +.subtitle { + display: flex; + align-items: center; + gap: 6px; + min-width: 0; + margin: 6px 0 20px 28px; color: var(--fg-muted); - font-family: var(--font-mono); font-size: var(--fs-small); - overflow-wrap: anywhere; - white-space: pre-wrap; } -.status { - margin: 6px 0 24px; - color: var(--fg-muted); - font-size: var(--fs-small); +.dot { + flex: none; + width: 6px; + height: 6px; + border-radius: 50%; + background: var(--fg-subtle); +} +.dotFound { + background: var(--success); +} +.dotCustom { + background: var(--accent); +} +.launch { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-family: var(--font-mono); +} +.section { + margin: 20px 0 6px; + font-size: var(--fs-ui); + font-weight: 600; + color: var(--fg-strong); +} +.section + .hint { + margin-top: 0; } .hint code { font-family: var(--font-mono); diff --git a/src/features/agents/BuiltinAgents.tsx b/src/features/agents/BuiltinAgents.tsx index 89156bdb8..760a5eb2a 100644 --- a/src/features/agents/BuiltinAgents.tsx +++ b/src/features/agents/BuiltinAgents.tsx @@ -2,19 +2,26 @@ import { useCallback, useEffect, useState } from "react"; import type { AgentProvider } from "@/bindings"; import { tx, useTx } from "@/platform/i18n"; -import { Badge, Button, Icon, IconButton, Input, List, Spinner, T } from "@/ui"; +import clsx from "clsx"; +import { Button, Icon, IconButton, Input, List, Spinner, T } from "@/ui"; import { useSettingsForm } from "@/workbench/contributions"; import { providerIcon } from "./model"; import type { CommandsBackend } from "./registry"; import styles from "./BuiltinAgents.module.css"; +/** Trailing list tag: a missing agent is a normal state, so it is muted rather than a warning. */ function Status({ agent }: { agent: AgentProvider }) { - const translate = useTx(); - if (!agent.commandOverridden && agent.installed) return null; + if (agent.commandOverridden) + return ( + + Custom + + ); + if (agent.installed) return null; return ( - - {agent.commandOverridden ? translate("Custom") : translate("Not found")} - + + Not found + ); } @@ -55,7 +62,7 @@ export function BuiltinAgents({ backend, onChanged }: { backend: CommandsBackend rowHeight={32} aria-label={tx("Built-in agents")} renderItem={(p) => ( -
+
{p.name}
@@ -95,22 +102,28 @@ function Details({ } }, [base, current, saving, refresh]); const launch = [agent.defaultProgram, ...agent.defaultArgs].join(" "); + const status = agent.commandOverridden + ? tx("Custom executable") + : agent.installed + ? tx("Found on PATH") + : tx("Not found on PATH"); return (

{agent.name}

- {launch} -

- {agent.commandOverridden ? ( - Custom executable - ) : agent.installed ? ( - Found on PATH - ) : ( - Not found on PATH - )} -

+
+ + {status} + · + + {launch} + +
{agent.commandEditable ? ( <>

Leave empty to find the executable on PATH. Changes apply to new sessions. @@ -160,9 +175,14 @@ function Details({

)} {agent.loginHint && ( -

- -

+ <> +

+ Sign in +

+

+ +

+ )} {error && (

diff --git a/src/platform/locales/text/zh.json b/src/platform/locales/text/zh.json index 66b57c654..7760826c1 100644 --- a/src/platform/locales/text/zh.json +++ b/src/platform/locales/text/zh.json @@ -8,6 +8,8 @@ "Built-in agents": "内置智能体", "Custom executable": "自定义可执行文件", "Found on PATH": "已在 PATH 中找到", + "Launch command": "启动命令", + "Sign in": "登录", "Leave empty to find the executable on PATH. Changes apply to new sessions.": "留空以从 PATH 查找可执行文件。更改对新会话生效。", "Newer dependency version available": "有更新的依赖版本可用", "Not found": "未找到", diff --git a/src/ui/List.module.css b/src/ui/List.module.css index c7ceb70a4..10d4917bb 100644 --- a/src/ui/List.module.css +++ b/src/ui/List.module.css @@ -3,6 +3,9 @@ min-height: 0; overflow: auto; outline: none; + /* Rows are controls: a page that opts into text selection must not select them on drag / ⌘A. */ + -webkit-user-select: none; + user-select: none; } .list::-webkit-scrollbar { width: 10px;