Repository navigation
fix(app-shell): AI-draft discard says it deletes an item that was never published - #38602
Conversation
…er published Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbamiNxp7695qyaEYsH
…ed item Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbamiNxp7695qyaEYsH
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbamiNxp7695qyaEYsH
…-draft-discard-copy
…never-published object Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbamiNxp7695qyaEYsH
…-draft-discard-copy
…ect in its own words Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbamiNxp7695qyaEYsH
…e AI line does Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbamiNxp7695qyaEYsH
|
repo:objectstack#2 · os-warren · session_01JQwxba2oTCUuCosPm6pkRu 速读
席位核对 — ACCEPT · Head-sha: 560eb6e
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbamiNxp7695qyaEYsH
|
repo:objectstack#2 · os-warren · session_01JQwxbamiNxp7695qyaEYsH
State: pr_ready + auto-merge (merge queue). Release freeze: exempt as in-development work (Warren 2026-11-30 07:08Z 「目前已经开发中的不用冻结」). check-governed-merges: NOT governed. |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46374718429 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Warren · project thread
Fixes #38302
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
StudioAiDraftNoticetakes apublishedreading.falsetitles the discard withengine.studio.aiDraft.discardTitleUnpublished;trueorundefined(host cannot tell) keepsengine.studio.aiDraft.discardTitle.aiDraftDiscardConfirmUnsaved(locale, published)picks the confirm asked over an unsaved edit:engine.studio.aiDraft.discardConfirmUnsavedUnpublishedfor a never-published item, the currentdiscardConfirmUnsavedotherwise.engine.studio.aiDraft.discardTitleUnpublished,engine.studio.aiDraft.discardConfirmUnsavedUnpublished,engine.studio.owd.aiDraftDiscardConfirmUnsavedUnpublished.publishedreads the sameflowPublishedthe AI line does (one expression, no behaviour change).read.published.has(name)(already used by its person-draft discard).publishedFlowNames(the publishedlistResponse,undefinedwhile unread or failed).row.published, confirm inpairObjectActions.aiDraftPublishedon the hooks buffer (the publishedlist()names), confirm inobjectHooksBuffer.row.saved; a never-published object's unsaved-edit confirm uses its own new key,engine.studio.owd.aiDraftDiscardConfirmUnsavedUnpublished(the object is deleted and only this row's unsaved change goes with it: the discard keeps every other row's edit).!holdsNoLayer(layered)(an item whose layers read holds no layer), for the title and the in-app confirm.StudioAiDraftNoticehost; folded in by claim amendment 1):hasBaseline(the object's layers read serves an effective or code version), already held by the pillar, no new fetch. Title through the newaiDraftDiscardTitle(locale, published)helper, which the notice uses too.Tests
New pins, keys named and never copy:
StudioAiDraftNotice.neverPublished-38302.test.tsx: the line (title perpublished, the confirm helper, both keys present in en and zh), the Hooks tab (published-list reader) and the generic item page (layers reader), each with a never-published and a published item, on the title and the unsaved-edit confirm; and the sharing overview, a never-published object with a dirty row (title, the OWD confirm key and not the page-wide one, declined keeps the edit).DataPillar.aiDraftNeverPublished-38302.test.tsx: the Data pillar's AI line (hasBaselinereader): never-published object on the title and the unsaved-edit confirm, plus a published-object control. Harness copied fromDataPillar.aiDraftDiscard-36511.test.tsx.Local readings (head 560eb6e, after merging origin/main f5da514)
pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build, os-verify-lock VERDICT command-exit 0.PackageOwdOverviewPanel.aiDraftNotice-36660: Test Files 3 passed, Tests 21 passed.PackageOwdOverviewPanel.aiDraftNotice-36660andAutomationsPillar.saveCancel-36511: Test Files 4 passed, Tests 27 passed.@object-ui/app-shelltype-check(tsc --noEmitplustsconfig.test.json): exit 0 at 560eb6e, 0 errors (run outside the lock, same reason).published === falsechoices inStudioAiDraftNotice.tsxforced tofalse ?: 4 failed / 7 passed; restored.DataPillar.tsxpassingtrueforhasBaselineto both helpers: 2 failed / 1 passed; restored.engine.studio.aiDraft.discardConfirmUnsavedUnpublished: 1 failed / 11 passed (the OWD never-published case); restored.Gates (head 560eb6e)
dispatch-gates --commands(15 paths): the same 39 commands. 38 exit 0;check:type-check-debtfirst exited 3 on its own lock queue-timeout, rerun exit 0 (surplus none).pnpm --dir ui exec vitest run scripts/, reason: lock queue-timeout (exit 99) behind a sibling's run. It was green at 6dcdcd2 (172 passed, 2 skipped); this delta touches noui/scriptsinput. CI is the reading.overlap-check.mjs: VERDICT clean exit 0 before each push. uicheck:new-line-citations: 0 new at 6dcdcd2.Acceptance notes
DataPillar.tsx, to the file surface.Verification
Read first:
StudioAiDraftNotice.tsx(the choice and both helpers),objectHooksBuffer.ts(new published-names state),DataPillar.tsx(thehasBaselinereading).Two-minute check: in Studio, have the AI assistant create a new object, then hover 「放弃 AI 的改动」 on its AI line: the tooltip says the item has never been published and dropping its draft deletes it. On an object that already exists, the tooltip still says it goes back to the live version.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbamiNxp7695qyaEYsH