Repository navigation
Commit 6ddf827
feat(app-shell): Connect an Agent asks which AI client you use and shows only its steps (#30943)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao4R5vgzn4JR1Ewtt4rWD5cr)_
Fixes #30896
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:「连接智能体」页不再一次铺开七张卡片。端点与 SKILL.md 下载仍在最上方;其下先问「你用的是哪个 AI
助手?」(Claude、Codex、Cursor、WorkBuddy、豆包工作、千问办公),只显示所选那一个的步骤,切换一次点击,本浏览器记住选择;API
密钥表单移到底部折叠的「高级:脚本与 CI」。
- 为什么改:一个人只用一个客户端,原来要翻过另外六个客户端的说明才找到自己的步骤,API 密钥卡还混在客户端中间。实测页面主体从 1604
px 降到 664 px 高。
- 风险与回滚:只动这一个页面组件和新增的三条文案;选择存在本地浏览器(`os:pref:connect.client`),读不到时回到
Claude。密钥签发逻辑原样未改。回滚即 revert 本 PR。
-
先看:`ui/packages/app-shell/src/console/connect/ConnectAgentWidget.tsx`(Tabs
与 Collapsible 两处)、`connectClientPreference.ts`、测试文件末尾新增的 describe。
- 两分钟验证:打开 设置 → Connect an Agent,点「Codex」,刷新页面仍停在 Codex;点「高级:脚本与 CI」才出现
API 密钥表单。
- 需要你做的:无,席位落地。
- **席位意见**:ui 席 2 对照 head `953cfc49` 的 diff 复核:14 个文件、+448 /
−207,无受治理路径。各客户端步骤、片段与提示文字原样搬进 `Tabs`,只渲染所选一个;选择经控制台既有的偏好存储(`user`
范围,`os:pref:connect.client`)保存,读不到或已不提供的客户端回到 Claude;API
密钥卡整体移入默认折叠的「高级:脚本与 CI」,签发与确认逻辑未改,签发结果状态在父组件,折叠不会丢失。席位核对时更正了 changeset
里新增文案的条数(三条),此外无改动。CI 全绿,Clause-② no,不欠契约复审。同意落地。
## What changes
- `ConnectAgentWidget.tsx`: under the endpoint card (URL, copy, SKILL.md
download — unchanged, on top for everyone), a card asks "Which AI
assistant do you use?" and holds a `Tabs` picker from
`@object-ui/components` with the six clients in the order the page
offered them. Only the chosen client's steps render; every client's
steps, snippets and hints are the same text as before. The API key card
moves into a `Collapsible` "Advanced: scripts and CI" at the bottom,
closed by default; its mint/confirm logic is unchanged.
- `connectClientPreference.ts` (new): the client ids and the reader's
choice, declared through the console's one preference store
(`utils/workspacePreference.ts`, imported, not edited), `user` scope,
stored as `{"client":"CLIENT_ID","v":1}` under `os:pref:connect.client`.
A stored id the page no longer offers, an unreadable record, or storage
that throws reads as no choice → Claude. The store already wraps every
storage access in try/catch.
- i18n: three new keys (`connectAgent.client.title`,
`connectAgent.client.hint`, `connectAgent.advanced.title`) in all ten
console packs. PR #30902 is not on `main`, so they sit in today's
`zh.ts` / `pt.ts`.
- Root changeset `.changeset/30896-connect-agent-client-picker.md`
(`@object-ui/app-shell`, `@object-ui/i18n`: patch).
## Tests
`ConnectAgentWidget.keyName-13355.test.tsx` (the component's one harness
file):
- the three key-name cases open the Advanced section first, then assert
as before;
- the Chinese-clients block now walks the picker: tab order, each
client's body + hint on pick, each client's transport spelling;
- new top-level describe: endpoint + SKILL.md on top, Claude only with
no choice, key form collapsed until opened; one click switches and the
choice is stored and read back after remount; an unknown stored client
reads as Claude.
## Acceptance notes
- With no stored choice the picker opens on Claude rather than on an
empty state; the card asks the question in the card heading and shows
the first client's steps.
- The Chinese clients' hints still say "(create a key below)"; the key
form is below, now behind the Advanced trigger. #30898 rewrites this
copy.
- No widget heading follows the #30895 rename: the widget has none, the
page title is metadata.
- Three `no-explicit-any` lint warnings in the file are pre-existing
lines that moved.
## Verification
Head `6111073f` (my commit `181fd4df` + merge of `origin/main`
`33043bd8`, no overlap with this diff).
<details><summary>Live measure on a local deployment (showcase with the
fresh flag, console Vite dev), admin and member</summary>
Widget body height at a 1004 px wide pane:
- before (`main` 0e88208 source): admin 1604 px, member 1604 px.
Endpoint card, the Claude card, then Codex, Cursor, WorkBuddy, Doubao
Work, QwenWork and the API key card, all open.
- after: admin 664 px, member 664 px. Endpoint card, the picker card
showing Claude's steps, the closed "Advanced: scripts and CI" trigger.
- member click-through: pick Codex → Codex steps shown, `claude mcp add`
gone, `localStorage['os:pref:connect.client']` =
`{"client":"codex","v":1}`; reload → Codex still selected; API key name
input absent until Advanced is opened, present after.
</details>
<details><summary>Local tests and gates</summary>
- `pnpm --dir ui exec vitest run
packages/app-shell/src/console/connect/` → 9/9 passed (on 181fd4d and
again on 6111073)
- `pnpm --dir ui exec vitest run packages/i18n/` → 97 files, 1521
passed, 13 skipped
- `pnpm --dir ui exec vitest run
packages/app-shell/src/__tests__/product-neutral-renderer.ratchet.test.ts`
→ 32/32
- `pnpm --filter @object-ui/i18n run type-check && pnpm --filter
@object-ui/app-shell run type-check` → exit 0
- eslint on the three changed widget files → 0 errors; `pnpm
check:new-line-citations` → 0 new
- `dispatch-gates --commands` derived 36 commands on 181fd4d; all 36
exit 0 (incl. `node scripts/check-sdui-manifest.mjs`, `pnpm --dir ui
exec vitest run scripts/` 170 files passed); `--ran` reconciliation: 36
run, 0 NOT-MEASURED, 0 UNRUN.
</details>
<!-- signed: domain:ui#2 · os-tesla · session_01L9qibw7DekEe3wx5f3zphf
-->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c571165 commit 6ddf827
14 files changed
Lines changed: 448 additions & 207 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/console/connect
- i18n/src/locales
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| |||
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
77 | 91 | | |
78 | | - | |
| 92 | + | |
| 93 | + | |
79 | 94 | | |
80 | 95 | | |
81 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
82 | 112 | | |
83 | 113 | | |
84 | 114 | | |
| |||
143 | 173 | | |
144 | 174 | | |
145 | 175 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
166 | 179 | | |
167 | 180 | | |
168 | 181 | | |
169 | | - | |
170 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
171 | 194 | | |
172 | 195 | | |
173 | 196 | | |
174 | 197 | | |
175 | 198 | | |
176 | | - | |
177 | | - | |
| 199 | + | |
178 | 200 | | |
179 | 201 | | |
180 | 202 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
190 | 215 | | |
191 | 216 | | |
192 | | - | |
| 217 | + | |
193 | 218 | | |
194 | 219 | | |
195 | 220 | | |
| |||
202 | 227 | | |
203 | 228 | | |
204 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
0 commit comments