Repository navigation
fix(app-shell,plugin-chatbot): AI build page preview header reads the build card's label and live state; progress items show labels - #26538
Merged
Conversation
…d live state; progress shows labels Claude-Session: https://claude.ai/code/session_01ADHkmQw9ePD2KCzPfJGa6p Co-authored-by: Claude <noreply@anthropic.com>
…e state Claude-Session: https://claude.ai/code/session_01ADHkmQw9ePD2KCzPfJGa6p Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmQw9ePD2KCzPfJGa6p Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmQw9ePD2KCzPfJGa6p Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对 · ACCEPT · seat
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steve · project thread
Fixes #26469
Clause-②: no
Metadata-protocol: none
维护者速读
onBuildResult;物化且appHidden: false的构建现在在卡片上也算已上线。回滚即 revert 本 PR。ui/packages/app-shell/src/console/ai/AiChatPage.tsx(handleBuildResult)、ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx(BuildProgressPanel 的上报 effect 与 buildIsLive)、ui/packages/app-shell/src/console/ai/LiveCanvas.tsx(标题三分支)。cd ui && pnpm exec vitest run packages/app-shell/src/console/ai/LiveCanvas.header-26469.test.tsx packages/app-shell/src/console/ai/__tests__/AiChatPage.canvasHeader-26469.test.tsx,预期 8 个用例全绿。What changes
LiveCanvas.tsx,AiChatPage.tsx).LiveCanvastakesappLabelandlive. The header shows the label (falling back to the machine name), and whenliveis true it reads 「运行预览 · LABEL」 / "Live app — LABEL" (new keyconsole.ai.liveCanvasLive), with no unlisted note whatevermaterializedsays. A materialized build that is not live keeps 「(未发布 · 仅自己可见)」.AiChatPagekeeps the card's answer per app name (buildResults), fed only byonBuildResult, and hands it to both canvas mounts (desktop split and mobile overlay). It is stored apart fromcanvasAppbecause the card's effect runs before its host's: on a reopened conversation the report arrives beforeonBuildMaterializedopens the canvas. Cleared with the canvas on a conversation change.ChatbotEnhanced.tsx). New optional proponBuildResult({ appName, label?, live }), passed toBuildProgressPanel. The panel reports, from an effect, the very values its title renders:builtApp.name,checklist.app.label ?? appLabel, andisDone && live. It fires again whenever one of them changes, which is how the header follows a publish. No second state derivation: the header shows what the card shows.ChatbotEnhanced.tsxbuildIsLive,mapMessages.ts).DraftReviewlifts the envelope'sappHiddenwhen it is a boolean.buildIsLivealso holds when the draft review saysmaterialized: trueandappHidden: false(ADR-0045: publish = live AND visible).appHidden: trueadds nothing. What else readsbuildIsLive: only the finished card'sliveprop (its 「已搭建并上线」 vs 「已搭建」 title) and, through the panel, the newonBuildResultreport. Nothing else in the file reads it.mapMessages.ts,ChatbotEnhanced.tsx).extractBuildProgresskeeps a non-empty stringlabelon an item;ChatBuildProgress.itemsgains the optionallabel; the panel renderslabeland falls back to the_sample-stripped name. Until objectstack-ai/cloud#3310 addslabelto the frames, the panel looks as before.chatbot.build.draftPosture, every locale). Names Publish in the chat instead of Studio: zh 「之后的修改先存草稿,在对话里点「发布」即可上线。」, en "Later changes are saved as drafts; click Publish here in the chat to make them live." Each locale quotes its ownconsole.ai.publishDraftslabel..changeset/26469-ai-build-canvas-header-labels.md:@object-ui/app-shell,@object-ui/plugin-chatbot,@object-ui/i18n, patch.The draft tool card's 「发布 (N)」 block (shared with #26471) is untouched.
Tests
New:
plugin-chatbot/src/__tests__/ChatbotEnhanced.buildResultHeader-26469.test.tsx(9): a labelled item shows its label and an unlabelled one its name; the stream reader keepslabel; a published build reports{label, live: true}; a drafted build reportslive: falseand reportslive: trueafter a rerender into published; the checklist label wins as on the title; materialized +appHidden: falsereads 「Built and live」 and reports live; materialized +appHidden: trueis not live;detectDraftResultliftsappHiddenonly when present; the zh footnote.app-shell/src/console/ai/LiveCanvas.header-26469.test.tsx(4, shipped zh pack): published → label, no 未发布; materialized not live → badge; no label → machine name; draft preview by label.app-shell/src/console/ai/__tests__/AiChatPage.canvasHeader-26469.test.tsx(4): materialized + card not live → canvas propsmaterialized, not live, label; card turns live → canvas turns live; a report before the canvas opens still reaches it; another app's report leaves the canvas alone.Forced test edits:
plugin-chatbot/src/__tests__/ChatbotEnhanced.buildChat-12724.test.tsxpinned the old zh posture sentence (「之后的修改先存草稿,由你在 Studio 发布。」); it now pins the new one.i18n/src/__tests__/de-quote-pairing-3876.test.tscounts the de pack's correctly paired 「„…“」 spans; the new dedraftPostureadds one (the chat's „Veröffentlichen“ button), so its two pins move 96 → 97 with a line in each running tally, as every earlier addition did.Acceptance notes
live, which is the existing result-card signal (published envelope, the package's pending-draft count reaching 0, this chat's publish signal) plus the new listed-materialized arm. When the card says live but the build was not materialized (an auto-publish environment), the iframe still opens the draft overlay (?preview=draft) as before; only the header text changed. With no pending drafts the overlay shows the published app.label, the cloud posture strings) is objectstack-ai/cloud#3310. Nothing here fakes it.Verification
Everything at head
af7a3dae, branched offorigin/main00a4593a; no file of this PR moved onmainsince (checked againstorigin/mainbefore opening).Targeted vitest (7 files, 90 tests)
cd ui && pnpm exec vitest run --maxWorkers=2over the three new files plusChatbotEnhanced.buildChat-12724.test.tsx,mapMessages.test.ts,LiveCanvas.test.tsx,AiChatPage.previewDraft-12968.test.tsx:Test Files 7 passed (7),Tests 90 passed (90), lock VERDICT command-exit 0.Package suites
pnpm --filter @object-ui/plugin-chatbot test --maxWorkers=2: 85 files, 814 tests passed.pnpm --filter @object-ui/i18n test --maxWorkers=2: 87 files passed; 1353 tests passed, 13 skipped.cd ui && pnpm exec vitest run --maxWorkers=2 packages/app-shell/src/console/ai/: 45 files, 245 tests passed. The whole app-shell suite (about 1,700 files) is left to CITest Core/Test UI; this is a declared narrowing to the directory the change lives in.Ablations (each restored, blob == HEAD, `git diff HEAD` empty)
All through
scripts/ablation-replace.mjs(anchor 1 → 0 on disk); ui vitest resolves@object-ui/*tosrc/, so no build sits between mutation and run.AiChatPage.tsxhandleBuildResultstoreslive: false:AiChatPage.canvasHeader-264692 failed / 2 passed (the publish-update and report-before-open cases).LiveCanvas.tsxdisplayName = appName(label ignored):LiveCanvas.header-264693 failed / 1 passed.LiveCanvas.tsxlive branch forced off:LiveCanvas.header-264691 failed / 3 passed (the published case).ChatbotEnhanced.tsxbuildIsLivelisted-materialized arm never matches:ChatbotEnhanced.buildResultHeader-264691 failed / 8 passed (appHidden: falsereads live).Derived gates (`dispatch-gates --commands`, 35)
All 35 at
af7a3dae, eachexit 0(codes captured before any pipe);dispatch-gates --ran: 35 derived, 35 run, 0 NOT-MEASURED (a derived zero).pnpm --dir ui exec vitest run scripts/: 178 files passed, 2 skipped; 5097 tests passed.Also run (outside the derived list):
uicheck:i18n-keys,check:i18n-drift,check:i18n-dead-keys,check:i18n-designer-parity, each exit 0.Type check
pnpm --filter @object-ui/plugin-chatbot --filter @object-ui/i18n --filter @object-ui/app-shell run type-check(bothtsc --noEmitandtsc -p tsconfig.test.jsonper package) afterturbo run build --filter='@object-ui/app-shell^...': lock VERDICT command-exit 0.Generated by Claude Code