@steerable/agent-shell-web 0.14.5 → 0.14.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/components/chat/LocalChatPanel.tsx +26 -1
- package/src/components/settings/AgentsSettingsPanel.tsx +3 -3
- package/src/components/settings/AppUpdateSettingsPanel.tsx +67 -43
- package/src/components/settings/AppearanceSettingsPanel.tsx +101 -134
- package/src/components/settings/CliInstallSettingsPanel.tsx +25 -23
- package/src/components/settings/DiagnoseSettingsPanel.tsx +3 -3
- package/src/components/settings/InsightsSettingsPanel.tsx +5 -7
- package/src/components/settings/LlmSettingsPanel.tsx +22 -2
- package/src/components/settings/McpSettingsPanel.tsx +4 -5
- package/src/components/settings/MemorySettingsPanel.tsx +210 -159
- package/src/components/settings/OrchestrationSettingsPanel.tsx +79 -121
- package/src/components/settings/PortableSettingsPanel.tsx +62 -49
- package/src/components/settings/PythonRunnerSettingsPanel.tsx +2 -4
- package/src/components/settings/SecuritySettingsPanel.tsx +91 -70
- package/src/components/settings/SettingsSidebar.tsx +238 -0
- package/src/components/settings/SkillsSettingsPanel.tsx +3 -4
- package/src/components/settings/TelemetrySettingsPanel.tsx +2 -7
- package/src/components/settings/UsagePanel.tsx +27 -35
- package/src/components/settings/WebSearchSettingsPanel.tsx +89 -88
- package/src/components/settings/primitives.tsx +302 -0
- package/src/components/settings/settings-registry.ts +371 -0
- package/src/layouts/AgentLayout.tsx +106 -6
- package/src/lib/chat-draft-store.ts +43 -0
- package/src/packs/registry.ts +2 -0
- package/src/pages/AgentPage.tsx +11 -1
- package/src/pages/SettingsPage.tsx +327 -489
- package/src/styles/index.css +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steerable/agent-shell-web",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Steerable framework — product-neutral renderer SPA source for @steerable/agent-shell (React + Vite). Consumed by product web entry points via the `@/` alias (anchored at this package's src/) and the createProductViteConfig factory. Published as a source package (src/), plus the compiled vite.base config factory (vite.base.js + .d.ts) for Node-side config loading.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"react-router-dom": "^6.30.0",
|
|
46
46
|
"rehype-raw": "^7.0.0",
|
|
47
47
|
"remark-gfm": "^4.0.1",
|
|
48
|
-
"@steerable/agent-protocol": "0.14.
|
|
49
|
-
"@steerable/agent-ui": "0.14.
|
|
48
|
+
"@steerable/agent-protocol": "0.14.6",
|
|
49
|
+
"@steerable/agent-ui": "0.14.6"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tailwindcss/vite": "^4.3.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"typescript": "^5.8.3",
|
|
60
60
|
"vite": "^5.4.21",
|
|
61
61
|
"vitest": "^3.2.4",
|
|
62
|
-
"@steerable/pack-sdk": "0.14.
|
|
62
|
+
"@steerable/pack-sdk": "0.14.6"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"gen": "echo agent-shell-web",
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
type AttachmentFile,
|
|
35
35
|
} from '@/lib/attachments';
|
|
36
36
|
import { parseModeSlashCommand } from '@/lib/chat-mode-store';
|
|
37
|
+
import { clearChatDraft, getChatDraft, setChatDraft } from '@/lib/chat-draft-store';
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
40
|
* LocalChatPanel — the product chat shell.
|
|
@@ -183,6 +184,8 @@ export interface LocalChatPanelProps {
|
|
|
183
184
|
*/
|
|
184
185
|
suggestedReplies?: string[];
|
|
185
186
|
onSelectSuggestion?: (text: string) => void;
|
|
187
|
+
/** 切去设置页或切换会话时在内存中保留未发送草稿文本。 */
|
|
188
|
+
preserveDraft?: boolean;
|
|
186
189
|
}
|
|
187
190
|
|
|
188
191
|
export function LocalChatPanel({
|
|
@@ -246,8 +249,27 @@ export function LocalChatPanel({
|
|
|
246
249
|
onShare,
|
|
247
250
|
suggestedReplies,
|
|
248
251
|
onSelectSuggestion,
|
|
252
|
+
preserveDraft = false,
|
|
249
253
|
}: LocalChatPanelProps) {
|
|
250
|
-
const [inputValue,
|
|
254
|
+
const [inputValue, setInputValueState] = useState(() =>
|
|
255
|
+
preserveDraft ? getChatDraft(chatId) : '',
|
|
256
|
+
);
|
|
257
|
+
const setInputValue = useCallback(
|
|
258
|
+
(next: string | ((prev: string) => string)) => {
|
|
259
|
+
setInputValueState((prev) => {
|
|
260
|
+
const resolved = typeof next === 'function' ? next(prev) : next;
|
|
261
|
+
if (preserveDraft) {
|
|
262
|
+
setChatDraft(chatId, resolved);
|
|
263
|
+
}
|
|
264
|
+
return resolved;
|
|
265
|
+
});
|
|
266
|
+
},
|
|
267
|
+
[preserveDraft, chatId],
|
|
268
|
+
);
|
|
269
|
+
useEffect(() => {
|
|
270
|
+
if (!preserveDraft) return;
|
|
271
|
+
setInputValueState(getChatDraft(chatId));
|
|
272
|
+
}, [preserveDraft, chatId]);
|
|
251
273
|
const [files, setFiles] = useState<AttachmentFile[]>([]);
|
|
252
274
|
const [attachmentError, setAttachmentError] = useState<string | null>(null);
|
|
253
275
|
const [mentionReferences, setMentionReferences] = useState<MentionReference[]>([]);
|
|
@@ -339,6 +361,9 @@ export function LocalChatPanel({
|
|
|
339
361
|
const submittedMentions = mentionReferences;
|
|
340
362
|
// 失败项留在输入框里,用户可以直接重试 / 移除;成功项随消息发出后清掉。
|
|
341
363
|
const failedFiles = failures.map((f) => f.file);
|
|
364
|
+
if (preserveDraft) {
|
|
365
|
+
clearChatDraft(chatId);
|
|
366
|
+
}
|
|
342
367
|
setInputValue('');
|
|
343
368
|
setFiles(failedFiles);
|
|
344
369
|
setMentionReferences([]);
|
|
@@ -214,15 +214,15 @@ export function AgentsSettingsPanel({
|
|
|
214
214
|
};
|
|
215
215
|
|
|
216
216
|
return (
|
|
217
|
-
<div className="space-y-
|
|
218
|
-
<p className="text-
|
|
217
|
+
<div className="space-y-4">
|
|
218
|
+
<p className="text-xs leading-relaxed text-agent-muted-foreground">
|
|
219
219
|
{t(
|
|
220
220
|
'Custom agents appear in the expert picker above the input box. The role prompt opens the conversation as its persona, and the checked skills and tool permissions apply on every turn. Built-in agents can have their text and capabilities edited, but cannot be deleted.',
|
|
221
221
|
)}
|
|
222
222
|
</p>
|
|
223
223
|
|
|
224
224
|
{formOpen ? (
|
|
225
|
-
<div className="space-y-
|
|
225
|
+
<div className="space-y-3 rounded-agent-md border border-agent-border bg-agent-canvas p-4">
|
|
226
226
|
<h4 className="text-xs font-semibold text-agent-foreground">
|
|
227
227
|
{editingId ? t('Edit agent') : t('New agent')}
|
|
228
228
|
</h4>
|
|
@@ -1,60 +1,70 @@
|
|
|
1
1
|
import { LuInfo } from 'react-icons/lu';
|
|
2
|
+
import { BRAND_NAME } from '@/brand';
|
|
2
3
|
import { useAppRelease } from '@/components/SidebarRelease';
|
|
3
4
|
import { t } from '@/i18n';
|
|
5
|
+
import { SettingRow, SettingSection } from './primitives';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
+
* 版本与更新面板:
|
|
9
|
+
* - 独立挂载(未传 showFallbackBrand)且无桌面版本信息时保持返回 null,兼容存量单测;
|
|
10
|
+
* - 在「关于」子页(showFallbackBrand=true)常驻展示应用名称与当前版本号,不额外渲染冗余二级标题。
|
|
8
11
|
*/
|
|
9
|
-
export function AppUpdateSettingsPanel(
|
|
12
|
+
export function AppUpdateSettingsPanel({
|
|
13
|
+
showFallbackBrand = false,
|
|
14
|
+
}: {
|
|
15
|
+
showFallbackBrand?: boolean;
|
|
16
|
+
} = {}) {
|
|
10
17
|
const release = useAppRelease();
|
|
11
|
-
if (!release.version) return null;
|
|
18
|
+
if (!release.version && !showFallbackBrand) return null;
|
|
19
|
+
|
|
12
20
|
const detail =
|
|
13
21
|
release.actionTitle && release.actionTitle !== release.actionLabel
|
|
14
22
|
? release.actionTitle
|
|
15
23
|
: null;
|
|
16
24
|
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
25
|
+
const body = (
|
|
26
|
+
<div className="space-y-4">
|
|
27
|
+
<SettingSection>
|
|
28
|
+
<SettingRow
|
|
29
|
+
title={release.version ? t('Current version') : BRAND_NAME}
|
|
30
|
+
description={
|
|
31
|
+
<>
|
|
32
|
+
{release.version ? (
|
|
33
|
+
<span className="tabular-nums" data-testid="settings-app-version">
|
|
34
|
+
v{release.version}
|
|
35
|
+
</span>
|
|
36
|
+
) : (
|
|
37
|
+
<span data-testid="settings-app-version">{t('Web client')}</span>
|
|
38
|
+
)}
|
|
39
|
+
{detail ? <span className="mt-1 block">{detail}</span> : null}
|
|
40
|
+
</>
|
|
41
|
+
}
|
|
42
|
+
control={
|
|
43
|
+
release.actionLabel ? (
|
|
44
|
+
<button
|
|
45
|
+
type="button"
|
|
46
|
+
className={[
|
|
47
|
+
'flex h-7 shrink-0 items-center rounded-full px-3 text-xs transition-colors',
|
|
48
|
+
release.emphasize
|
|
49
|
+
? 'bg-agent-foreground font-medium text-agent-canvas hover:opacity-90'
|
|
50
|
+
: 'border border-agent-border text-agent-foreground hover:bg-agent-foreground/5',
|
|
51
|
+
release.clickable ? '' : 'cursor-default opacity-60',
|
|
52
|
+
].join(' ')}
|
|
53
|
+
data-testid="settings-app-update"
|
|
54
|
+
title={release.actionTitle}
|
|
55
|
+
disabled={!release.clickable}
|
|
56
|
+
onClick={release.run}
|
|
57
|
+
>
|
|
58
|
+
{release.actionLabel}
|
|
59
|
+
</button>
|
|
60
|
+
) : null
|
|
61
|
+
}
|
|
62
|
+
/>
|
|
63
|
+
</SettingSection>
|
|
64
|
+
|
|
55
65
|
{release.releaseNotes ? (
|
|
56
66
|
<div
|
|
57
|
-
className="rounded-
|
|
67
|
+
className="rounded-lg border border-agent-border/70 bg-agent-muted/20 p-3.5 text-xs"
|
|
58
68
|
data-testid="settings-app-release-notes"
|
|
59
69
|
>
|
|
60
70
|
<p className="font-medium text-agent-foreground">
|
|
@@ -67,6 +77,20 @@ export function AppUpdateSettingsPanel() {
|
|
|
67
77
|
</div>
|
|
68
78
|
</div>
|
|
69
79
|
) : null}
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
if (showFallbackBrand) {
|
|
84
|
+
return body;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<section className="space-y-2" data-testid="settings-section-update">
|
|
89
|
+
<h2 className="flex items-center gap-1.5 text-xs font-semibold text-agent-foreground">
|
|
90
|
+
<LuInfo className="h-3.5 w-3.5 text-agent-muted-foreground" />
|
|
91
|
+
{t('About')}
|
|
92
|
+
</h2>
|
|
93
|
+
{body}
|
|
70
94
|
</section>
|
|
71
95
|
);
|
|
72
96
|
}
|
|
@@ -3,9 +3,11 @@ import {
|
|
|
3
3
|
THINKING_DISPLAY_OPTIONS,
|
|
4
4
|
persistThinkingDisplay,
|
|
5
5
|
useThinkingDisplay,
|
|
6
|
+
type ThinkingDisplayMode,
|
|
6
7
|
} from '@/lib/show-thinking-content';
|
|
7
8
|
import { getHostBridge } from '@/lib/host-bridge';
|
|
8
9
|
import { localeEndonym, supportedLocales, useI18n } from '@/i18n';
|
|
10
|
+
import { SettingRow, SettingSection, SettingSegmented } from './primitives';
|
|
9
11
|
|
|
10
12
|
function stepZoom(scale: number, direction: -1 | 1): number {
|
|
11
13
|
const snapped = Math.round(scale * 10) / 10;
|
|
@@ -36,153 +38,118 @@ function InterfaceZoomRow() {
|
|
|
36
38
|
if (!available || scale == null) return null;
|
|
37
39
|
const percent = Math.round(scale * 100);
|
|
38
40
|
return (
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
41
|
+
<SettingRow
|
|
42
|
+
testId="interface-zoom"
|
|
43
|
+
title={t('Interface zoom')}
|
|
44
|
+
description={t('Adjust overall text size and control scale across the app.')}
|
|
45
|
+
control={
|
|
46
|
+
<div className="flex items-center gap-1.5">
|
|
47
|
+
<button
|
|
48
|
+
type="button"
|
|
49
|
+
className="flex h-7 w-7 items-center justify-center rounded-md border border-agent-border bg-agent-canvas text-sm text-agent-foreground transition-colors hover:bg-agent-muted/60 disabled:opacity-30"
|
|
50
|
+
aria-label={t('Zoom out')}
|
|
51
|
+
data-testid="interface-zoom-out"
|
|
52
|
+
disabled={percent <= 80}
|
|
53
|
+
onClick={() => {
|
|
54
|
+
const next = stepZoom(scale, -1);
|
|
55
|
+
setScale(next);
|
|
56
|
+
void getHostBridge()?.setZoom?.(next);
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
−
|
|
60
|
+
</button>
|
|
61
|
+
<span
|
|
62
|
+
className="min-w-[3.25rem] text-center font-mono text-xs tabular-nums text-agent-foreground"
|
|
63
|
+
data-testid="interface-zoom-level"
|
|
64
|
+
>
|
|
65
|
+
{percent}%
|
|
66
|
+
</span>
|
|
67
|
+
<button
|
|
68
|
+
type="button"
|
|
69
|
+
className="flex h-7 w-7 items-center justify-center rounded-md border border-agent-border bg-agent-canvas text-sm text-agent-foreground transition-colors hover:bg-agent-muted/60 disabled:opacity-30"
|
|
70
|
+
aria-label={t('Zoom in')}
|
|
71
|
+
data-testid="interface-zoom-in"
|
|
72
|
+
disabled={percent >= 200}
|
|
73
|
+
onClick={() => {
|
|
74
|
+
const next = stepZoom(scale, 1);
|
|
75
|
+
setScale(next);
|
|
76
|
+
void getHostBridge()?.setZoom?.(next);
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
+
|
|
80
|
+
</button>
|
|
81
|
+
<button
|
|
82
|
+
type="button"
|
|
83
|
+
className="h-7 rounded-md border border-agent-border bg-agent-canvas px-2.5 text-xs text-agent-muted-foreground transition-colors hover:bg-agent-muted/60 hover:text-agent-foreground"
|
|
84
|
+
data-testid="interface-zoom-reset"
|
|
85
|
+
onClick={() => {
|
|
86
|
+
setScale(1);
|
|
87
|
+
void getHostBridge()?.setZoom?.(1);
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
{t('Reset')}
|
|
91
|
+
</button>
|
|
92
|
+
</div>
|
|
93
|
+
}
|
|
94
|
+
/>
|
|
91
95
|
);
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
99
|
+
* 界面偏好(Codex 式细分割线行):
|
|
100
|
+
* - 语言切换(多语言产品时显示,右侧紧凑分段器);
|
|
101
|
+
* - 桌面客户端界面缩放;
|
|
102
|
+
* - 思考过程正文展示档位(隐藏 / 显示5行 / 完整显示),立即写入 localStorage。
|
|
97
103
|
*/
|
|
98
104
|
export function AppearanceSettingsPanel() {
|
|
99
105
|
const { t, locale, setLocale } = useI18n();
|
|
100
106
|
const mode = useThinkingDisplay();
|
|
101
|
-
const current = THINKING_DISPLAY_OPTIONS.find((item) => item.mode === mode);
|
|
102
107
|
const locales = supportedLocales();
|
|
103
108
|
|
|
104
109
|
return (
|
|
105
|
-
<
|
|
110
|
+
<SettingSection title={t('Interface')}>
|
|
106
111
|
{locales.length > 1 ? (
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
aria-checked={selected}
|
|
126
|
-
data-testid={`locale-option-${item}`}
|
|
127
|
-
onClick={() => setLocale(item)}
|
|
128
|
-
className={[
|
|
129
|
-
'h-7 flex-1 rounded-full px-2 text-xs transition-colors',
|
|
130
|
-
selected
|
|
131
|
-
? 'bg-agent-foreground/10 text-agent-foreground'
|
|
132
|
-
: 'text-agent-muted-foreground hover:text-agent-foreground',
|
|
133
|
-
].join(' ')}
|
|
134
|
-
>
|
|
135
|
-
{localeEndonym(item)}
|
|
136
|
-
</button>
|
|
137
|
-
);
|
|
138
|
-
})}
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
112
|
+
<SettingRow
|
|
113
|
+
testId="locale-settings"
|
|
114
|
+
title={t('Language')}
|
|
115
|
+
description={t('Display language for the application interface.')}
|
|
116
|
+
control={
|
|
117
|
+
<SettingSegmented
|
|
118
|
+
value={locale}
|
|
119
|
+
ariaLabel={t('Language')}
|
|
120
|
+
testId="locale-toggle"
|
|
121
|
+
onChange={setLocale}
|
|
122
|
+
options={locales.map((item) => ({
|
|
123
|
+
value: item,
|
|
124
|
+
label: localeEndonym(item),
|
|
125
|
+
testId: `locale-option-${item}`,
|
|
126
|
+
}))}
|
|
127
|
+
/>
|
|
128
|
+
}
|
|
129
|
+
/>
|
|
141
130
|
) : null}
|
|
142
|
-
<div
|
|
143
|
-
className="space-y-2 rounded-agent-md border border-agent-border bg-agent-card p-2.5"
|
|
144
|
-
data-testid="appearance-settings-panel"
|
|
145
|
-
>
|
|
146
|
-
<div>
|
|
147
|
-
<p className="text-xs font-medium text-agent-foreground">{t('Show thinking')}</p>
|
|
148
|
-
<p className="mt-1 text-xs leading-relaxed text-agent-muted-foreground">
|
|
149
|
-
{current ? t(current.hint) : null}{' '}
|
|
150
|
-
{t(
|
|
151
|
-
'These options only control the thinking text. Tool cards and work rows stay as they are. A work row shows "Working", or the count and elapsed time after it finishes.',
|
|
152
|
-
)}
|
|
153
|
-
</p>
|
|
154
|
-
</div>
|
|
155
|
-
<div
|
|
156
|
-
className="flex w-full rounded-full border border-agent-border bg-agent-canvas p-0.5"
|
|
157
|
-
role="radiogroup"
|
|
158
|
-
aria-label={t('Show thinking')}
|
|
159
|
-
data-testid="thinking-display-toggle"
|
|
160
|
-
>
|
|
161
|
-
{THINKING_DISPLAY_OPTIONS.map((item) => {
|
|
162
|
-
const selected = mode === item.mode;
|
|
163
|
-
return (
|
|
164
|
-
<button
|
|
165
|
-
key={item.mode}
|
|
166
|
-
type="button"
|
|
167
|
-
role="radio"
|
|
168
|
-
aria-checked={selected}
|
|
169
|
-
aria-label={t(item.label)}
|
|
170
|
-
data-testid={`thinking-display-${item.mode}`}
|
|
171
|
-
onClick={() => persistThinkingDisplay(item.mode)}
|
|
172
|
-
className={[
|
|
173
|
-
'h-7 flex-1 rounded-full px-2 text-xs transition-colors',
|
|
174
|
-
selected
|
|
175
|
-
? 'bg-agent-foreground/10 text-agent-foreground'
|
|
176
|
-
: 'text-agent-muted-foreground hover:text-agent-foreground',
|
|
177
|
-
].join(' ')}
|
|
178
|
-
>
|
|
179
|
-
{t(item.label)}
|
|
180
|
-
</button>
|
|
181
|
-
);
|
|
182
|
-
})}
|
|
183
|
-
</div>
|
|
184
|
-
</div>
|
|
185
131
|
<InterfaceZoomRow />
|
|
186
|
-
|
|
132
|
+
<SettingRow
|
|
133
|
+
testId="appearance-settings-panel"
|
|
134
|
+
title={t('Show thinking')}
|
|
135
|
+
description={t(
|
|
136
|
+
'Control how much thinking text is shown during the current turn. Collapses automatically once the turn ends.',
|
|
137
|
+
)}
|
|
138
|
+
control={
|
|
139
|
+
<SettingSegmented<ThinkingDisplayMode>
|
|
140
|
+
value={mode}
|
|
141
|
+
ariaLabel={t('Show thinking')}
|
|
142
|
+
testId="thinking-display-toggle"
|
|
143
|
+
onChange={persistThinkingDisplay}
|
|
144
|
+
options={THINKING_DISPLAY_OPTIONS.map((item) => ({
|
|
145
|
+
value: item.mode,
|
|
146
|
+
label: t(item.label),
|
|
147
|
+
ariaLabel: t(item.label),
|
|
148
|
+
testId: `thinking-display-${item.mode}`,
|
|
149
|
+
}))}
|
|
150
|
+
/>
|
|
151
|
+
}
|
|
152
|
+
/>
|
|
153
|
+
</SettingSection>
|
|
187
154
|
);
|
|
188
155
|
}
|
|
@@ -29,29 +29,31 @@ export function CliInstallSettingsPanel(props: {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
|
-
<div className="space-y-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
32
|
+
<div className="space-y-3 border-t border-b border-agent-border/60 py-3.5" data-testid="cli-install-settings">
|
|
33
|
+
<div className="flex items-center justify-between gap-6">
|
|
34
|
+
<p className="text-xs leading-relaxed text-agent-muted-foreground">
|
|
35
|
+
{t('Install the command-line tool on your PATH so you can run it from a terminal.')}
|
|
36
|
+
</p>
|
|
37
|
+
<button
|
|
38
|
+
type="button"
|
|
39
|
+
data-testid="cli-install-button"
|
|
40
|
+
onClick={() => void onClick()}
|
|
41
|
+
disabled={running}
|
|
42
|
+
className="inline-flex h-8 shrink-0 items-center gap-1.5 rounded-full bg-agent-foreground px-3.5 text-xs font-medium text-agent-canvas transition hover:opacity-90 disabled:opacity-50"
|
|
43
|
+
>
|
|
44
|
+
{running ? (
|
|
45
|
+
<>
|
|
46
|
+
<LuLoader className="h-3.5 w-3.5 animate-spin" />
|
|
47
|
+
{t('Installing…')}
|
|
48
|
+
</>
|
|
49
|
+
) : (
|
|
50
|
+
<>
|
|
51
|
+
<LuTerminal className="h-3.5 w-3.5" />
|
|
52
|
+
{t('Install command-line tool')}
|
|
53
|
+
</>
|
|
54
|
+
)}
|
|
55
|
+
</button>
|
|
56
|
+
</div>
|
|
55
57
|
{message && (
|
|
56
58
|
<p data-testid="cli-install-message" className="text-xs text-agent-foreground">
|
|
57
59
|
{message}
|
|
@@ -139,8 +139,8 @@ export function DiagnoseSettingsPanel() {
|
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
return (
|
|
142
|
-
<div className="space-y-
|
|
143
|
-
<p className="text-xs text-agent-muted-foreground">
|
|
142
|
+
<div className="space-y-3 border-t border-agent-border/60 pt-3">
|
|
143
|
+
<p className="text-xs leading-relaxed text-agent-muted-foreground">
|
|
144
144
|
{t(
|
|
145
145
|
'Diagnose network connectivity to the current model service, including DNS resolution, TCP connection, TLS handshake, the HTTP endpoint, and chat completion.',
|
|
146
146
|
)}{' '}
|
|
@@ -153,7 +153,7 @@ export function DiagnoseSettingsPanel() {
|
|
|
153
153
|
type="button"
|
|
154
154
|
onClick={() => void run()}
|
|
155
155
|
disabled={running}
|
|
156
|
-
className="inline-flex items-center gap-1.5 rounded-
|
|
156
|
+
className="inline-flex h-8 items-center gap-1.5 rounded-full bg-agent-foreground px-3.5 text-xs font-medium text-agent-canvas transition hover:opacity-90 disabled:opacity-50"
|
|
157
157
|
>
|
|
158
158
|
{running ? (
|
|
159
159
|
<>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { LuChartBar } from 'react-icons/lu';
|
|
3
2
|
import { BRAND_NAME } from '@/brand';
|
|
4
3
|
import { t } from '@/i18n';
|
|
5
4
|
import { getHostBridge, hasHostBridge } from '@/lib/host-bridge';
|
|
@@ -203,13 +202,12 @@ export function InsightsSettingsPanel() {
|
|
|
203
202
|
const stats = data.stats ?? empty.stats!;
|
|
204
203
|
|
|
205
204
|
return (
|
|
206
|
-
<div className="space-y-3" data-testid="insights-settings-panel">
|
|
207
|
-
<div className="
|
|
208
|
-
<
|
|
209
|
-
<LuChartBar className="h-3.5 w-3.5 text-agent-muted-foreground" />
|
|
205
|
+
<div className="space-y-3 border-t border-agent-border/60 pt-3" data-testid="insights-settings-panel">
|
|
206
|
+
<div className="space-y-3">
|
|
207
|
+
<p className="sr-only">
|
|
210
208
|
{t('Help improve the product (behavior / conversations / user info are confirmed separately)')}
|
|
211
|
-
</
|
|
212
|
-
<p className="text-
|
|
209
|
+
</p>
|
|
210
|
+
<p className="text-xs leading-relaxed text-agent-muted-foreground">
|
|
213
211
|
{t(
|
|
214
212
|
'Even if the user does not agree to upload, records stay on this device. You can export JSON and send it to the product team, or click "Upload now" once.',
|
|
215
213
|
)}
|