Skip to content

Commit 84d209d

Browse files
feat(console): the chat's draft review card publishes a draft, pinned to the version the turn saved (#39014)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBCBEbFaYjr1yVnYsDrfd5rS)_ Fixes #38983 Fixes #39015 Clause-②: yes (widening) Metadata-protocol: added Skills-docs: none — the row is a stream part a host writes for the chat, which no skill teaches; the docs page `content/docs/frontend/plugins/plugin-chatbot.mdx` is updated here ## 维护者速读 - 用户能看到什么变化:助手搭建完后,对话里的草稿审阅卡上每个草稿多了「发布」按钮,人点一下就发布这一个草稿,结果(已发布、被拒及原因、本轮之后有改动未发布)留在卡上。 - 为什么做:云端专题「助手搭建应用」第二阶段,人不用再跳到应用搭建里去发布。 - 出错会怎样:只有带版本号、判定可发布的草稿能点;草稿在本轮之后被改过会被拒、什么都不发布;AI 仍然不能自己发布。版本号要云端写进审阅卡,云端补上之前按钮是灰的。 - 要你做什么:无。 ## What changes - **Spec** (`packages/spec/src/ai/draft-review.zod.ts`): `DraftReviewItemSchema` gains the optional `version` (non-empty string), the draft's version token as the turn's last save of it wrote it. The docblock's "What the card does not do / Nothing is published or discarded from the chat" flips to "What the card publishes": one draft per click, as the person, pinned through `draftVersion`; nothing discarded. Reference page regenerated. - **Card** (`ui/packages/plugin-chatbot/src/chat/DraftReviewCard.tsx`): with a host `onPublishDraft`, each row carries a Publish button. Enabled only on a row with a `version` and a `publishable` verdict; otherwise disabled with the reason in its title and accessible name (`noVersion`, `withheld`, `refusals`). The row keeps the click's result: `published` (button gone), `conflict` (draft changed since the turn, button gone), `refused` with the platform's code and sentence (button stays for another try). A host that throws is shown as a refusal. With no host prop the card is unchanged (no buttons). `ChatbotEnhanced` passes the prop through; its comment line saying nothing is published here flips. - **Host** (`ui/packages/app-shell/src/console/ai/draftReviewPublish.ts`, new): `publishReviewedDraft` reuses `publishDetailSave` (the item page's pinned item publish) with `packageId` = the row's package, `draftVersion` = the row's version and `hadDraft` = true, so a refusal never takes the assistant's draft back. 409 `METADATA_CONFLICT` maps to `conflict`; anything else to `refused` with the error's code and message. A row with no version is never sent. `ChatPane` wires it in (one import, one hook call, one prop; the file stays at 1,000 lines). - **i18n**: 12 `chatbot.draftReview.*` keys in all 11 locale packs (zh-Hant regenerated). - **#39015, folded in** (same file, describe-only): `verdictWithheld`'s `.describe()` and the docblock line now also cover a draft the door left unjudged under a bound such as `MAX_RECORDS_EXCEEDED`; shape unchanged. - **Docs**: `content/docs/frontend/plugins/plugin-chatbot.mdx` § Draft review card teaches `onPublishDraft` and drops "no publish control". - **Changeset**: `minor` on spec (the `Check Changeset` gate reads `packages/spec/authorable-surface/ai.json` gaining `ai/DraftReviewItem:version`, an authorable key added), patch on plugin-chatbot, app-shell, i18n; says the "nothing is published from the chat" contract changes. Seat rulings carried (card thread order): optional version key, Clause-② yes (widening); the protocol line moved from the agreed `none` to `added` because the authorable-surface ratchet records `DraftReviewItem`, and the gate refuses `none` on a moved shard; the docblock and the ChatbotEnhanced line flip, the changeset says so; no producer of the part lives in this repo (the cloud host fills it), so this ships the key plus the button and Publish is disabled on a row with no version. The cloud producer follow-up is the seat's to file. Discard (optional on the card) is not built. Risk-ranked first reads: `DraftReviewCard.tsx` `publishBlock` and `publishControl` (what is clickable, what each result shows); `draftReviewPublish.ts` (pin and conflict mapping); the spec docblock flip. ## Tests Run on 86fbd98 (objectstack-ai/objectstack, main 571b494 base); the head now adds docs, the changeset and the #39015 wording only: - `pnpm --dir ui exec vitest run packages/plugin-chatbot/src/__tests__/DraftReviewCard-38048.test.tsx packages/plugin-chatbot/src/__tests__/DraftReviewCard.i18n-38048.test.tsx packages/app-shell/src/console/ai/draftReviewPublish-38983.test.ts`: 3 files, 22 tests passed. - Card (new top-level describe in the card's harness file): publishes the publishable versioned row through `onPublishDraft` and shows it published; refused, withheld and unversioned rows are disabled with the reason and never call the host; conflict shown, no second Publish; `PERMISSION_DENIED` shown with code and sentence, Publish kept; a throwing host shown as a refusal. - Host (against the `draftPublishDoor` fake that enforces the draft pin): the turn's draft goes live with `{ packageId, draftVersion }`; a draft another writer changed is `conflict`, not live, kept, no reset; a 403 refusal carries code and message, no reset; no version, no publish call. - Ablation: dropping `draftVersion` from the host's publish turns 2 of 4 host tests red (the pin assertion and the conflict PIN); restored from HEAD, tree clean. - `pnpm --filter @objectstack/spec exec vitest run src/ai/draft-review.test.ts`: 13 passed (new: version kept, optional, empty and non-string refused with path). - `pnpm --filter @object-ui/plugin-chatbot type-check` exit 0; `pnpm --filter @object-ui/app-shell type-check` exit 0 (both incl. tsconfig.test.json). - `pnpm --filter @objectstack/spec check:generated`: `content/docs/references/**` was stale, regenerated with `--fix`, re-check green. ## Acceptance notes - Acceptance 1–3 are pinned in this PR at the framework layer; they hold end to end once the cloud host states each row's `version` in the `data-draft-review` part. Until then every row's Publish is disabled ("Publish this draft in App Studio."). - Acceptance 4's staging browser check is cloud's, recorded on objectstack-ai/cloud#5304. - The cloud remainder (the host fills each row's `version` from the save receipt, plus the staging browser check) is asked of triage for a cloud card: #36743 comment 7330317456. This PR completes the framework side. - The eager en locale chunk budget (`check-eager-locale-catalogues` / `check-eager-closure-budget`) needs a console build: NOT MEASURED locally, read from CI. ## Verification Two minutes: run the vitest line under Tests; the five `objectstack#38983` cases in the card harness and four in `draftReviewPublish-38983.test.ts` pass. <details><summary>Derived gate families (local subset)</summary> `node scripts/pm/dispatch-gates.mjs --commands` derived 112 commands on 86fbd98; run one by one, exit code captured before any pipe. Later heads add only docs, the changeset and one `.describe()` wording (spec rebuilt and `check:generated` re-run green on them). - 108 of 112 exit 0. - NOT MEASURED, exit 3 (prerequisite, not a finding): `check-plugin-teardown-shape.mjs --self-test` (its fixture is pinned to a commit this shallow clone cannot reach), `check:skill-examples` (needs a `@objectstack/client-react` dist), `check:dual-build-cjs-loads` (needs every package's dist). - NOT MEASURED, exit 124: `check:type-check-debt` (its re-measure passed the 300 s local cap). - CI runs all four. Report: #38983 comment 7331415099. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WGufziUBsnPje7KHsByhN5 --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufziUBsnPje7KHsByhN5)_ <!-- signed: repo:objectstack@os-support-ai · os-support-ai · session_01WGufziUBsnPje7KHsByhN5 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2f9a68c commit 84d209d

25 files changed

Lines changed: 652 additions & 36 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@object-ui/plugin-chatbot': patch
4+
'@object-ui/app-shell': patch
5+
'@object-ui/i18n': patch
6+
---
7+
8+
feat(console): the chat's draft review card publishes a draft, pinned to the version the turn saved
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: added
12+
13+
Widened: `DraftReviewItemSchema` (`@objectstack/spec/ai`, the row of the `data-draft-review` stream part) gains the optional `version`, the draft's version token as the turn's last save of it wrote it (the save receipt's `version`). `DraftReviewCardProps` and `ChatbotEnhancedProps` gain the optional `onPublishDraft`, and `@object-ui/plugin-chatbot` exports the type `DraftReviewPublishResult`; the card's Publish strings are added to every shipped locale pack.
14+
15+
The contract that nothing is published from the chat changes. The review card under an ask turn's answer now carries a Publish button per draft: one click publishes that one draft as the signed-in person, through the item's own publish (`POST /meta/:type/:name/publish?package=`), with the row's `version` sent as the body's `draftVersion`. A draft changed after the turn saved it is refused `409 METADATA_CONFLICT`, nothing is published, and the row says the draft changed since the turn. Any other refusal (a member who may not publish gets `PERMISSION_DENIED`) is shown on the row with the platform's code and sentence. Publish is offered only on a row that carries a `version` and whose verdict is `publishable`; a refused, withheld or unversioned row shows it disabled with the reason and is published in Studio through the review links, as before. The agent is given no publish: the click is always the person's. Nothing is discarded from the chat.
16+
17+
`verdictWithheld`'s description now also covers a draft the door left unjudged under a bound such as `MAX_RECORDS_EXCEEDED`, not only a verdict the person may not read; its shape is unchanged.
18+
19+
A host that fills the `data-draft-review` part must state each row's `version` for the button to be enabled; a part without it draws the card as before, with Publish disabled.
20+
21+
Why the protocol line reads added: `DraftReviewItem` is on the authorable surface the ratchet records (`packages/spec/authorable-surface/ai.json`), and `version` is a key that enters it. Nothing a released version accepts is refused now.

‎content/docs/frontend/plugins/plugin-chatbot.mdx‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,17 +627,20 @@ itself; a part the schema refuses draws nothing.
627627

628628
```tsx
629629
import { DraftReviewCard } from '@object-ui/plugin-chatbot';
630-
import type { DraftReviewListParsed } from '@objectstack/spec/ai';
630+
import type { DraftReviewPublishResult } from '@object-ui/plugin-chatbot';
631+
import type { DraftReviewItemParsed, DraftReviewListParsed } from '@objectstack/spec/ai';
631632

632-
export function TurnDrafts({ review, navigate }: {
633+
export function TurnDrafts({ review, navigate, publish }: {
633634
review: DraftReviewListParsed;
634635
navigate: (path: string) => void;
636+
publish: (draft: DraftReviewItemParsed) => Promise<DraftReviewPublishResult>;
635637
}) {
636638
return (
637639
<DraftReviewCard
638640
review={review}
639641
onOpenReviewLink={navigate} // in-app navigation keeps the live conversation
640642
reviewLinkHref={(path) => `/_console${path}`} // the router's basename, for a new tab
643+
onPublishDraft={publish} // one draft, as the person, pinned to its version
641644
/>
642645
);
643646
}
@@ -649,7 +652,15 @@ export function TurnDrafts({ review, navigate }: {
649652
by the save rather than at the turn's end says "checked when saved".
650653
- Rows are grouped by package, in save order; each package has one "Review and
651654
publish" link to its Changes drawer. `omitted` shows as "+N more".
652-
- The card has no publish and no discard control: a person publishes or
655+
- With `onPublishDraft`, each row has a Publish button that publishes that one
656+
draft as the signed-in person. The host sends the item's own publish with
657+
the row's `version` as the body's `draftVersion`, so a draft changed since
658+
the turn is refused (`409 METADATA_CONFLICT`) and nothing is published. The
659+
button is enabled only on a row with a `version` and a publishable verdict;
660+
any other row shows it disabled with the reason. The row keeps the result:
661+
"Published", "Changed since this turn", or the platform's refusal with its
662+
code. The Console's chat pane passes a host that does exactly this.
663+
Without the prop the card has no publish control. It never discards: a person
653664
discards in Studio, through the links.
654665
- A plain click on a link calls `onOpenReviewLink` with the Console path; a
655666
modified or middle click keeps the browser's own behaviour, on the href

‎content/docs/references/ai/draft-review.mdx‎

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ draws them in a card under the answer.
3232
draft — `publishable` is "no refusal", `refusals` are what a publish would
3333
refuse it on and `advisories` are findings that do not block it — read as
3434
the person who asked. `null` when no verdict was read: `verdictWithheld`
35-
then says why the person may not read one, or `verdictError` that reading
36-
it failed. Both carry the door's `{ code, message, status }`.
35+
then says why the door gave none (the person may not read one, or the door
36+
left the draft unjudged under a bound such as `MAX_RECORDS_EXCEEDED`; the
37+
`message` says which), or `verdictError` that reading it failed. Both carry
38+
the door's `{ code, message, status }`.
3739
- `verdictRead` says when the verdict was read: `turn-end`, after the turn's
3840
last save, or `save`, by the save that wrote this draft (a later save in
3941
the same turn can change it).
@@ -42,13 +44,25 @@ draws them in a card under the answer.
4244
`studioItemReviewLink` in `@objectstack/types`): `changes`, the package's
4345
Changes drawer, where it is published, and `item`, the draft's own review.
4446
Both are Console paths, so each starts with one `/`.
45-
46-
## What the card does not do
47-
48-
Nothing is published or discarded from the chat: a person publishes in
49-
Studio, through the review routes, as for any draft. The part is drawn live
50-
only: it is not stored with the message, so a conversation reloaded from
51-
history shows no card.
47+
- `version` is the draft's version token as the turn's last save of it
48+
wrote it (the save receipt's `version`), when the producer states one.
49+
50+
## What the card publishes
51+
52+
A person may publish a listed draft from the chat, one draft per click, as
53+
the person signed in: the card sends that draft's own publish
54+
(`POST /meta/:type/:name/publish?package=`) with `version` as the body's
55+
`draftVersion` (`PublishMetaItemRequestSchema.draftVersion`). The pin is
56+
what makes the click mean "publish what the card shows": a draft changed
57+
after the turn saved it is refused `409 METADATA_CONFLICT` and nothing is
58+
published. So the card offers Publish only on a row that carries a
59+
`version` and whose `verdict` is `publishable`; any other row is published
60+
in Studio, through the review routes, as for any draft. The agent is given
61+
no publish: the click is always the person's. Nothing is discarded from the
62+
chat.
63+
64+
The part is drawn live only: it is not stored with the message, so a
65+
conversation reloaded from history shows no card.
5266

5367
<Callout type="info">
5468
**Source:** `packages/spec/src/ai/draft-review.zod.ts`
@@ -77,10 +91,11 @@ const result = DraftReviewItemSchema.parse(data);
7791
| **package** | `string` | ✅ | The package the draft was saved into |
7892
| **label** | `string` | optional | The draft's display label, when it has one |
7993
| **verdict** | `{ publishable: boolean; refusals: object[]; advisories: object[] } \| null` | ✅ | The door's `list_drafts` verdict, read as the person who asked; `null` when none was read (see `verdictWithheld` and `verdictError`) |
80-
| **verdictWithheld** | `{ code: string; message: string; status: integer }` | optional | Why the person may not read a verdict, when `verdict` is `null` for that reason |
94+
| **verdictWithheld** | `{ code: string; message: string; status: integer }` | optional | Why the door gave no verdict, when `verdict` is `null` for that reason: the person may not read it, or the door left the draft unjudged under a bound such as `MAX_RECORDS_EXCEEDED`; the `message` says which |
8195
| **verdictError** | `{ code: string; message: string; status: integer }` | optional | That reading the verdict failed, when `verdict` is `null` for that reason |
8296
| **verdictRead** | `Enum<'turn-end' \| 'save'>` | ✅ | When the verdict was read: `turn-end`, after the turn's last save, or `save`, by the save that wrote this draft |
8397
| **review** | `{ changes: string; item: string }` | ✅ | |
98+
| **version** | `string` | optional | The draft's version token as the turn's last save of it wrote it (the save receipt's `version`). The card's Publish sends it as the publish body's `draftVersion`, so a draft changed since is refused 409 `METADATA_CONFLICT`, never published; absent, the row offers no Publish in the chat |
8499

85100
### Nested Shape: `DraftReviewItem.verdict`
86101

@@ -146,10 +161,11 @@ const result = DraftReviewItemSchema.parse(data);
146161
| **package** | `string` | ✅ | The package the draft was saved into |
147162
| **label** | `string` | optional | The draft's display label, when it has one |
148163
| **verdict** | `{ publishable: boolean; refusals: object[]; advisories: object[] } \| null` | ✅ | The door's `list_drafts` verdict, read as the person who asked; `null` when none was read (see `verdictWithheld` and `verdictError`) |
149-
| **verdictWithheld** | `{ code: string; message: string; status: integer }` | optional | Why the person may not read a verdict, when `verdict` is `null` for that reason |
164+
| **verdictWithheld** | `{ code: string; message: string; status: integer }` | optional | Why the door gave no verdict, when `verdict` is `null` for that reason: the person may not read it, or the door left the draft unjudged under a bound such as `MAX_RECORDS_EXCEEDED`; the `message` says which |
150165
| **verdictError** | `{ code: string; message: string; status: integer }` | optional | That reading the verdict failed, when `verdict` is `null` for that reason |
151166
| **verdictRead** | `Enum<'turn-end' \| 'save'>` | ✅ | When the verdict was read: `turn-end`, after the turn's last save, or `save`, by the save that wrote this draft |
152167
| **review** | `{ changes: string; item: string }` | ✅ | |
168+
| **version** | `string` | optional | The draft's version token as the turn's last save of it wrote it (the save receipt's `version`). The card's Publish sends it as the publish body's `draftVersion`, so a draft changed since is refused 409 `METADATA_CONFLICT`, never published; absent, the row offers no Publish in the chat |
153169

154170

155171
---

‎packages/spec/authorable-surface/ai.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@
230230
"ai/DraftReviewItem:verdictError",
231231
"ai/DraftReviewItem:verdictRead",
232232
"ai/DraftReviewItem:verdictWithheld",
233+
"ai/DraftReviewItem:version",
233234
"ai/DraftReviewLinks:changes",
234235
"ai/DraftReviewLinks:item",
235236
"ai/DraftReviewList:drafts",

‎packages/spec/src/ai/draft-review.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ describe('DraftReviewItemSchema', () => {
118118
expect(firstIssue(DraftReviewItemSchema, { ...ROW, [key]: '' })).toMatchObject({ code: 'too_small', path: [key] });
119119
}
120120
});
121+
122+
it('keeps the draft version the card pins its Publish to, optional, and refuses an empty or non-string one', () => {
123+
const parsed = DraftReviewItemSchema.safeParse({ ...ROW, version: 'v-7f3a' });
124+
expect(parsed.success).toBe(true);
125+
expect(parsed.data!.version).toBe('v-7f3a');
126+
// Absent stays absent: a row with no version is still a row (the card offers no Publish on it).
127+
expect(DraftReviewItemSchema.safeParse(ROW).data).not.toHaveProperty('version');
128+
expect(firstIssue(DraftReviewItemSchema, { ...ROW, version: '' })).toMatchObject({ code: 'too_small', path: ['version'] });
129+
expect(firstIssue(DraftReviewItemSchema, { ...ROW, version: 7 })).toMatchObject({ code: 'invalid_type', path: ['version'] });
130+
});
121131
});
122132

123133
describe('DraftReviewListSchema and the data part', () => {

‎packages/spec/src/ai/draft-review.zod.ts‎

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ import { strictObject } from '../shared/strict-object';
3232
* draft — `publishable` is "no refusal", `refusals` are what a publish would
3333
* refuse it on and `advisories` are findings that do not block it — read as
3434
* the person who asked. `null` when no verdict was read: `verdictWithheld`
35-
* then says why the person may not read one, or `verdictError` that reading
36-
* it failed. Both carry the door's `{ code, message, status }`.
35+
* then says why the door gave none (the person may not read one, or the door
36+
* left the draft unjudged under a bound such as `MAX_RECORDS_EXCEEDED`; the
37+
* `message` says which), or `verdictError` that reading it failed. Both carry
38+
* the door's `{ code, message, status }`.
3739
* - `verdictRead` says when the verdict was read: `turn-end`, after the turn's
3840
* last save, or `save`, by the save that wrote this draft (a later save in
3941
* the same turn can change it).
@@ -42,13 +44,25 @@ import { strictObject } from '../shared/strict-object';
4244
* `studioItemReviewLink` in `@objectstack/types`): `changes`, the package's
4345
* Changes drawer, where it is published, and `item`, the draft's own review.
4446
* Both are Console paths, so each starts with one `/`.
47+
* - `version` is the draft's version token as the turn's last save of it
48+
* wrote it (the save receipt's `version`), when the producer states one.
4549
*
46-
* ## What the card does not do
50+
* ## What the card publishes
4751
*
48-
* Nothing is published or discarded from the chat: a person publishes in
49-
* Studio, through the review routes, as for any draft. The part is drawn live
50-
* only: it is not stored with the message, so a conversation reloaded from
51-
* history shows no card.
52+
* A person may publish a listed draft from the chat, one draft per click, as
53+
* the person signed in: the card sends that draft's own publish
54+
* (`POST /meta/:type/:name/publish?package=`) with `version` as the body's
55+
* `draftVersion` (`PublishMetaItemRequestSchema.draftVersion`). The pin is
56+
* what makes the click mean "publish what the card shows": a draft changed
57+
* after the turn saved it is refused `409 METADATA_CONFLICT` and nothing is
58+
* published. So the card offers Publish only on a row that carries a
59+
* `version` and whose `verdict` is `publishable`; any other row is published
60+
* in Studio, through the review routes, as for any draft. The agent is given
61+
* no publish: the click is always the person's. Nothing is discarded from the
62+
* chat.
63+
*
64+
* The part is drawn live only: it is not stored with the message, so a
65+
* conversation reloaded from history shows no card.
5266
*/
5367

5468
/**
@@ -133,12 +147,20 @@ export const DraftReviewItemSchema = lazySchema(() => strictObject(
133147
'The door\'s `list_drafts` verdict, read as the person who asked; `null` when none was read '
134148
+ '(see `verdictWithheld` and `verdictError`)',
135149
),
136-
verdictWithheld: DraftReviewVerdictRefusalSchema.optional().describe('Why the person may not read a verdict, when `verdict` is `null` for that reason'),
150+
verdictWithheld: DraftReviewVerdictRefusalSchema.optional().describe(
151+
'Why the door gave no verdict, when `verdict` is `null` for that reason: the person may not read it, or the door '
152+
+ 'left the draft unjudged under a bound such as `MAX_RECORDS_EXCEEDED`; the `message` says which',
153+
),
137154
verdictError: DraftReviewVerdictRefusalSchema.optional().describe('That reading the verdict failed, when `verdict` is `null` for that reason'),
138155
verdictRead: z.enum(['turn-end', 'save']).describe(
139156
'When the verdict was read: `turn-end`, after the turn\'s last save, or `save`, by the save that wrote this draft',
140157
),
141158
review: DraftReviewLinksSchema,
159+
version: z.string().min(1).optional().describe(
160+
'The draft\'s version token as the turn\'s last save of it wrote it (the save receipt\'s `version`). '
161+
+ 'The card\'s Publish sends it as the publish body\'s `draftVersion`, so a draft changed since is '
162+
+ 'refused 409 `METADATA_CONFLICT`, never published; absent, the row offers no Publish in the chat',
163+
),
142164
},
143165
));
144166

‎ui/packages/app-shell/src/console/ai/ChatPane.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import { useUpload } from '@object-ui/fields';
7171
import { isSpreadsheetAttachment, uploadChatAttachments, chatAttachmentNotes } from './chatAttachments.js';
7272
import { listLinkTarget, recordOpenTarget, nextSectionOpening } from './aiChatLinks.js';
7373
import { documentHref } from '../../views/documentHref.js';
74+
import { useDraftReviewPublish } from './draftReviewPublish.js';
7475
import { hydratedMessagesToChatMessages } from './aiChatHydration.js';
7576
import { localizeAgentLabel, agentEmptyState, buildAgentSuggestions } from './agentCopy.js';
7677
import { drawerSuggestions, type EmptyConversationSize } from './emptyConversationModel.js';
@@ -318,6 +319,7 @@ export function ChatPane({
318319
[navigate, openLinksInNewTab, openInNewTab],
319320
);
320321
const reviewLinkHref = useCallback((path: string) => documentHref(routerRootHref, path), [routerRootHref]);
322+
const publishReviewedDraft = useDraftReviewPublish();
321323

322324
// The pane's root, measured by the composer-draft handoff below.
323325
const paneRef = useRef<HTMLDivElement | null>(null);
@@ -850,6 +852,7 @@ export function ChatPane({
850852
onOpenList={openList}
851853
onOpenReviewLink={openReviewLink}
852854
reviewLinkHref={reviewLinkHref}
855+
onPublishDraft={publishReviewedDraft}
853856
// cloud#3565 — the record-write card's three buttons and its states.
854857
onOpenRecordForm={openRecordForm}
855858
recordWriteCreateTitle={(objectLabel) => t('console.ai.recordWriteCreateTitle', { object: objectLabel })}

0 commit comments

Comments
 (0)