From 8c9ddb987963e703b4206246f8dc238e836c60f4 Mon Sep 17 00:00:00 2001
From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com>
Date: Tue, 3 Nov 2026 22:20:58 +0800
Subject: [PATCH] fix(agents): tidy the Built-in agents settings page
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- List rows are no longer text-selectable. Settings pages enable text selection
for their content, and the shared List inherited it, so dragging or ⌘A
highlighted every row.
- An agent missing from PATH is shown as a muted row with a small "Not found"
label instead of an orange warning badge; a custom executable gets an accent
"Custom" label.
- The details header puts the status (with a status dot) and the launch command
on one line.
- Reset only appears when a custom executable is set.
- The sign-in hint gets its own "Sign in" heading.
- The list/details frame sizes to its content instead of filling the page.
---
src/features/agents/BuiltinAgents.module.css | 60 ++++++++++++++----
src/features/agents/BuiltinAgents.tsx | 66 +++++++++++++-------
src/platform/locales/text/zh.json | 2 +
src/ui/List.module.css | 3 +
4 files changed, 97 insertions(+), 34 deletions(-)
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 (
+
+
{launch}
-
- {agent.commandOverridden ? (
-
+ {launch}
+
+
-
+
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;