Repository navigation
Commit ffa6db1
fix(console): the publish-health line shows a finding's customer sentence and folds agent text under technical details (#34539)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X4KthxjbE68SmtZYZQBCfuQ)_
Part of #32984 — the console read of ruling 6929121584 (Q1 letter B,
parameter 4). The producer side that writes
`probes.issues[].userMessage` is #34513. This PR reads the field
tolerantly and lands before #34513, so everything below is true on
`main` without it: until #34513 lands, no finding carries a
`userMessage` and the line shows the generic sentence.
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
- 改了什么:AI 搭建对话里,发布后的健康提示行不再原样显示写给 AI
的英文检查结果。某条结果带有客户句(`userMessage`,平台的发布检查从 #34513
起开始提供)时,提示行显示这句话。没带时,显示搭建卡已在用的通用提示句(「这次搭建有部分内容需要修复后才能使用……」)。原始的检查文字统一折叠到「技术详情」里。示例数据加载失败也改用语言包里的句子(「示例数据未能加载。」)。首页「全部发布」的提示和
AI 对话里的待发布条,在示例数据加载失败但服务端没给原因时,仍会提示失败,不会误报「全部已上线」。
- 为什么改:维护者裁决 B「出问题的一方写客户句」,界面不再自己维护按错误码翻译的表。
- 风险与回滚:只改这一行的显示方式、两处发布提示判断失败的依据,以及 `publishHealthFromResponse`
读出的字段(新增三个可选字段)。`seedError` 现在只放服务端自己给的文字,可能为空;判断失败要读
`seedFailed`。回滚:revert 本 PR。
- 先看:`ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx` 的
`PublishHealthLine`,`ui/packages/plugin-chatbot/src/publishHealth.ts`,`ui/packages/app-shell/src/console/ai/PendingDraftsBar.tsx`
的 `seedFailed` 判断。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.needsAttention-32984.test.tsx
packages/app-shell/src/console/ai/__tests__/PendingDraftsBar.advisoryReachesAuthor.test.tsx
packages/app-shell/src/preview/__tests__/usePublishAllDrafts.refusal-11922.test.tsx`,预期全部通过。
- 需要你做的:无,席位落地。
## What changes
- `publishHealth.ts`: `PublishHealth.issues[]` gains optional
`userMessage` and `fix`. Each is read only when it is a non-empty
string. `PublishHealth.seedFailed` (optional) marks a failed seed load.
`seedError` now holds only the producer's own text, and is absent when
the producer sent none. The English 'Sample data failed to load.' the
reader used to make up is gone. A seed-loader finding object in
`seedApplied.errors[]` now gives its `message`. Before, `String()`
turned it into `[object Object]`.
- `PublishHealthLine`: a finding with a `userMessage` shows that
sentence on the line. Findings without one get a single generic
sentence, the same one the draft-issues block uses
(`chatbot.build.issuesSummary` when an error is in the set, else
`chatbot.build.warningsSummary`). Every finding's `message` (plus its
`fix`) and the seed loader's text go under a closed "Technical details"
(`chatbot.build.issuesDetails`). A failed seed reads
`chatbot.build.health.seedFailed`.
- `@object-ui/app-shell` (`usePublishAllDrafts`, `PendingDraftsBar`):
both read the failed-seed signal as `seedFailed === true ||
!!seedError`, the rule `PublishHealthLine` reads, instead of `seedError`
alone. With no producer text, the toast detail is the line's own
sentence, `t('chatbot.build.health.seedFailed')`: both readers hold the
i18n `t`, so no new key and no new English. Before this, a failed seed
with no producer text reached them as nothing, and the bar said "All
pending changes are live."
- `@object-ui/i18n`: one new key, `chatbot.build.health.seedFailed`, in
all eleven packs. zh-Hant is generated by `gen:zh-hant`. The existing
keys are reused because they fit.
- Seed text: `seedApplied.error` carries engine text (for example `seed
apply stopped at the seed for object 'x': …`, or `seed apply: no
readable seed bodies`), not a customer sentence. So the line always
shows the localized seed sentence, and that text appears only under the
details.
- Changeset: names `@object-ui/app-shell` (patch), the changed reading
of `seedError` beside "nothing is removed or renamed", and words the
customer sentence as conditional on the producer sending it (#34513).
## Tests
- New `describe` in `ChatbotEnhanced.needsAttention-32984.test.tsx` (the
shared I18nProvider harness), 6 cases: a finding with a `userMessage`
(the sentence is shown, and the agent text and fix appear only in the
closed details); one without (zh-Hans generic sentence, agent text only
under the details); warnings only; a mixed set; a failed seed in `ja`
with loader text kept as a detail; a failed seed with no producer text
(zh-Hans sentence, no English, no details).
- New top-level `describe` in
`usePublishAllDrafts.refusal-11922.test.tsx` (real hook, real health
reader): a batch whose `seedApplied` is `success: false` with no `error`
and empty `errors` gives one `home.pendingDrafts.seedWarn` warning whose
description is `chatbot.build.health.seedFailed`, and no success toast.
- New top-level `describe` in
`PendingDraftsBar.advisoryReachesAuthor.test.tsx` (real bar, real
client, real health reader): the same seed answer gives a "Published,
but …" warning naming "Sample data failed to load.", and no success
toast.
- Existing tests changed by this PR: `ChatbotEnhanced.test.tsx` (round
1) — the existing health cases now assert the new faces, and two new
`publishHealthFromResponse` cases cover non-empty-string reads, a loader
finding object, and no invented text. No existing test changed in round
2; the two new cases sit in existing harness files.
## Acceptance notes
- The toasts of `usePublishAllDrafts` and `PendingDraftsBar` still print
engine text and `issues[].message` verbatim, the same class this PR
fixes on the line. That is #34553. This PR fixes only the failure signal
in those two readers, not their text.
- Known and left as is: a voiced error (one with a `userMessage`) beside
an unvoiced warning gives the error's sentence and the red face.
- The package-less by-reference loop in `usePublishAllDrafts` reads
`seedApplied` directly (not through `seedError`) and already reports a
failed seed with or without text; it is not changed.
## Verification
<details><summary>Round 2 readings (head 266e140,
session_01ADHkmRH4UCX1tvddXMS7cq)</summary>
- Merged `origin/main` once (merge commit 266e140). Rebuilt the
`@objectstack/*` closure of `@object-ui/app-shell` (`turbo run build`,
42/42 tasks) and then its `@object-ui/*` closure (68/68 tasks), each
under os-verify-lock, VERDICT command-exit 0.
- `vitest run packages/plugin-chatbot/ packages/i18n/` plus the 38
app-shell test files that name `usePublishAllDrafts`, `PendingDraftsBar`
or `publishHealthFromResponse`: Test Files 241 passed (241), Tests 3179
passed, 13 skipped. VERDICT command-exit 0. Narrowed: the full app-shell
suite (about 2,300 files) is left to Test UI in CI.
- `type-check` for app-shell and plugin-chatbot (both tsc programs each,
test layer included): VERDICT command-exit 0.
- `pnpm --dir ui exec vitest run scripts/` (the i18n key gates, NOT
MEASURED in round 1): Test Files 171 passed, 2 skipped (173); Tests 5077
passed, 2 skipped. VERDICT command-exit 0.
- Ablation 3 (`scripts/ablation-replace.mjs`): `usePublishAllDrafts`
back to `if (health.seedError) {`. The new case failed: 1 failed, 4
passed. Restored: blob equals HEAD (81fa445) and `git diff HEAD` is
empty.
- Ablation 4: `PendingDraftsBar` back to `const seedFailed =
!!health?.seedError;`. The new case failed: 1 failed, 2 passed.
Restored: blob equals HEAD (66003c4) and `git diff HEAD` is empty.
- Derived gates (`dispatch-gates --commands`, 40) each run with exit
codes captured before any pipe: all exit 0. `--ran` reconciliation: 40
derived, 40 run, 0 NOT-MEASURED.
</details>
<details><summary>Round 1 readings (head 92fc05b)</summary>
- Build closure `turbo run build
--filter='@object-ui/plugin-chatbot^...' --concurrency=2` under
os-verify-lock: 49/49 tasks, VERDICT command-exit 0.
- `vitest run packages/plugin-chatbot/ packages/i18n/`: Test Files 203
passed (203), Tests 2912 passed, 13 skipped. Then `type-check` for
plugin-chatbot (both tsc programs, test layer included) and i18n.
VERDICT command-exit 0 for the chain.
- Ablation 1 (`scripts/ablation-replace.mjs`): voice every finding with
`userMessage ?? message`. 3 failed, 10 passed. Restored: blob equals
HEAD and `git diff HEAD` is empty.
- Ablation 2: the seed line prints `seedError ?? 'Sample data failed to
load.'`. 2 failed, 11 passed. Restored the same way.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01ADHkmRH4UCX1tvddXMS7cq
<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmRH4UCX1tvddXMS7cq -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent c493adb commit ffa6db1
20 files changed
Lines changed: 371 additions & 44 deletions
File tree
- .changeset
- ui/packages
- app-shell/src
- console/ai
- __tests__
- preview
- __tests__
- i18n/src/locales
- plugin-chatbot/src
- __tests__
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
117 | | - | |
| 125 | + | |
118 | 126 | | |
119 | 127 | | |
120 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
90 | 99 | | |
91 | 100 | | |
92 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4538 | 4538 | | |
4539 | 4539 | | |
4540 | 4540 | | |
| 4541 | + | |
4541 | 4542 | | |
4542 | 4543 | | |
4543 | 4544 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4165 | 4165 | | |
4166 | 4166 | | |
4167 | 4167 | | |
| 4168 | + | |
4168 | 4169 | | |
4169 | 4170 | | |
4170 | 4171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5096 | 5096 | | |
5097 | 5097 | | |
5098 | 5098 | | |
| 5099 | + | |
5099 | 5100 | | |
5100 | 5101 | | |
5101 | 5102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4259 | 4259 | | |
4260 | 4260 | | |
4261 | 4261 | | |
| 4262 | + | |
4262 | 4263 | | |
4263 | 4264 | | |
4264 | 4265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4255 | 4255 | | |
4256 | 4256 | | |
4257 | 4257 | | |
| 4258 | + | |
4258 | 4259 | | |
4259 | 4260 | | |
4260 | 4261 | | |
| |||
0 commit comments