Repository navigation
Commit 8e5ad14
fix(console): AI pane names no lone agent; the drawer drops the empty header row (#37160)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8Ew4Ge2RjXufCRJ9pCgKWSC)_
Fixes #37146
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:右侧 AI
助手只有一个智能体时,顶部不再出现只写着「提问」的那一行,对话区直接从标题栏下面开始;有两个及以上智能体时,切换器照旧。
- 为什么做:AI 搭建入口关闭后,目录里只剩「提问」一个,这一行没有东西可切,只是占地方(卡上你的原话)。
- 出错会怎样:只影响助手顶部这一行画不画;不改请求、不改数据,可直接整体撤回。
- 要你做什么:无。
## What changes
`ui/packages/app-shell/src/console/ai/AiChatPage.tsx`, the pane's
`headerSlot`:
- With one launchable agent (`showAgentLauncher` false) the row no
longer draws a `span` with the agent's name. The switcher arms (Tabs for
up to three agents, Select above) are unchanged.
- `headerHasContent` = a switcher, or the build package chip
(`isBuildSurface`), or Share/Doctor still in the row (`!actionsInHost`),
or the offline note (`agentsError`). When none holds, `ChatPane` passes
no `headerSlot`, so `ChatbotEnhanced` draws no wrapper, no band and no
border. That is the drawer case: its host lifts Share and the Build
Doctor into the drawer's title bar (`actionsInHost`, objectstack#35445).
- The full-page assistant follows the same rule. It keeps its row
because Share (and the Doctor where offered) sit there, now with no
agent name beside them.
- The row gets `data-testid="ai-chat-header"` so the test can name it.
Changeset: `.changeset/37146-ai-pane-lone-agent-header.md`
(`@object-ui/app-shell` patch).
## Why
Since the in-app build entry closed, the catalog usually serves only the
ask agent. The row had nothing to switch and read only 「提问」.
## Verification
New
`ui/packages/app-shell/src/console/ai/__tests__/AiChatPage.loneAgentHeader-37146.test.tsx`
renders the real `ChatPane` and the real `ChatbotEnhanced`. Only the
chat transport, the models list and the metadata and adapter providers
are stand-ins:
- drawer (actions lifted), one agent: no `ai-chat-agent-picker`, no
agent-name span, no header row;
- full page, one agent: no picker, the row holds Share, and no "Ask"
text;
- drawer and full page, two agents: the switcher renders;
- drawer, one agent on the build surface: the row stays for the package
chip.
Screenshots, right-side drawer at 1280×720, zh-CN, one `ask` agent
served. These are a scratch dev-server fixture (the real `ChatDockPanel`
+ `ChatDockConversation`, with the AI endpoints answered in the browser)
and are not committed. The project thread carries the image files:
1. Before (main `6f3a8da2`): under the 「AI 助手」 title bar, a bordered row
holding only 「提问」.
2. After: the empty state starts right under the title bar, with no row.
<details><summary>Readings (head b0c6e50)</summary>
- `pnpm --dir ui exec vitest run
packages/app-shell/src/console/ai/__tests__/AiChatPage.loneAgentHeader-37146.test.tsx`
→ 5 passed.
- Ablation: `AiChatPage.tsx` back to main's `headerSlot` (testid kept) →
the two one-agent cases go red (2 failed, 3 passed); the fixed file
restored → 5 passed.
- `pnpm --dir ui exec vitest run packages/app-shell/src/console/ai/
packages/app-shell/src/layout/` → Test Files 221 passed, Tests 1805
passed.
- `pnpm exec turbo run type-check --filter=@object-ui/app-shell` → 69/69
tasks successful.
- `node scripts/pm/dispatch-gates.mjs --commands` (merge base 6f3a8da,
3 paths) → 38 commands, all 38 exit 0 (incl. `pnpm --dir ui exec vitest
run scripts/`, `check:type-check-debt`,
`check:changeset-gate-self-tests`).
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(untouched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbWzzVHDadsqECHsTmd)_
<!-- signed: repo:cloud#1 · os-warren · session_01JQwxbWzzVHDadsqECHsTmd
-->
Co-authored-by: Claude <noreply@anthropic.com>1 parent c063734 commit 8e5ad14
3 files changed
Lines changed: 171 additions & 7 deletions
File tree
- .changeset
- ui/packages/app-shell/src/console/ai
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2782 | 2782 | | |
2783 | 2783 | | |
2784 | 2784 | | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
2785 | 2794 | | |
2786 | | - | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
2787 | 2798 | | |
2788 | 2799 | | |
2789 | 2800 | | |
| |||
2842 | 2853 | | |
2843 | 2854 | | |
2844 | 2855 | | |
2845 | | - | |
2846 | | - | |
2847 | | - | |
2848 | | - | |
2849 | | - | |
| 2856 | + | |
2850 | 2857 | | |
2851 | 2858 | | |
2852 | 2859 | | |
| |||
3082 | 3089 | | |
3083 | 3090 | | |
3084 | 3091 | | |
3085 | | - | |
| 3092 | + | |
3086 | 3093 | | |
3087 | 3094 | | |
3088 | 3095 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 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 | + | |
| 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 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
0 commit comments