Repository navigation
feat(console): a new chat conversation is about the record on the page until its first send, shown as a chip in the composer - #38230
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
…cus wording Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
…read during render Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
…only where an id arrives Holding the mark in state re-rendered the dock mid-send, and the record-page request-context send never left. The ref is read in one helper at the id's arrival, and the conversation's focus is copied to it in an insertion effect, so no other render path reads a ref. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 2c4561fc4aea6ef6d0df948289232df80b2906da && git checkout 2c4561fc4aea6ef6d0df948289232df80b2906da
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 88ae2f93db1e1a20ef365459d65cc3a18da84862 37dccd4c922d77697beeaad4cb47f238ba0e1b42 && git checkout -B drift-repro 88ae2f93db1e1a20ef365459d65cc3a18da84862 && git merge --no-ff 37dccd4c922d77697beeaad4cb47f238ba0e1b42
node scripts/docs-audit/affected-docs.mjs --json 88ae2f93db1e1a20ef365459d65cc3a18da84862
|
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i Contract review brief — PR #38230 @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i Contract reviewServed-tier: ① Derived judgmentsRead: card #37861 with its three comments, the PR body, the 27-file list, the net diff against main at
② Semver levelThe changeset moves
③ Boundary flags
④ Design judgment
Implementing files, sentence by sentence:
S1 (should-fix) — the first-send mark can land on a conversation that has already sent, and replace the focus that conversation was fixed on. N1 (nit) — the PR body says the metadata label is "trimmed and capped at 200 chars". N2 (nit) — two comments outside the diff still say "pin": Not judged here: whether a chip row on the top edge inside the frame is what the card means by "at the line start". That is the maintainer's eye, not the contract. No must-fix. One should-fix, S1, open on this head. Its fix earns a delta review. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-28T09:39Z 席位核对 — L1 @
|
…te minted A send made while the dock resolves a thread joins the thread it finds, and a history row opened while the create is on the wire is that row's conversation: both keep the focus they were fixed on, instead of taking the page's record. useChatConversation returns createdConversationId, the row its own create minted; another target while unsent spends the mark. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
…ser's submit clears its message field Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i Contract reviewServed-tier: ① Derived judgmentsThis is a delta record on record 7237372817 (head
② Semver levelUnchanged: four packages at ③ Boundary flags
④ Design judgmentThe fix ( S1 (should-fix) — still open, narrowed.
In both, the held message is sent into U with the new Fix direction: make the created id good for one use. For example, N1: closed N2 (nit) — unchanged. Two comments outside the diff still say "pin" ( No must-fix. One should-fix, S1, still open on this head. Its fix earns a delta review. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-28T11:31Z 席位核对 — L1 delta @
|
…that send createdConversationId is the row the hook minted last and is never cleared, so a thread an earlier send of this dock created, resolved again or opened from history while a send waited, took the page's record. The mark now keeps the id the hook held when the send was made, and only a newer one takes it. The per-target spend is gone: the held send marks again after a target change, so it never decided anything. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i Contract reviewServed-tier: ① Derived judgmentsThis is the second delta record. It follows 7237372817 (head
② Semver levelUnchanged: four packages at ③ Boundary flags
④ Design judgmentThe fix ( I tried to break it on the paths of the last record, and on new ones.
The one way left for the rule to miss goes the safe way. If a create finishes while the pane is given no id (the scope does not match), and the held send marks again before the id is given, the new row restores an empty entry and its first turn carries no focus. Nothing is added to a conversation that should not have it. I do not grade it. The docblocks agree with the code. The two new cases match the two paths of the last record: a thread the dock created and cleared with ×, found again while a send waits, and opened from history while a later create is in flight. Both assert that the stored entry stays The contract sentences "the first send fixes it" and "it stays until the user removes it" ( S1: closed N1: closed N2 (nit) — unchanged. Two comments outside the diff still say "pin" ( No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-28T12:42Z 席位核对 — L1 delta @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-28T12:44Z · zone
|
repo:objectstack#3 · os-tesla · session_01L9qibwivzADop4jGmFZ81y
Fixes #37861
Clause-②: yes (widening) —
@object-ui/plugin-chatbotChatbotEnhancedgains the optionalpromptInputHeaderSlot;@object-ui/app-shellUseChatConversationReturngainsconversationMetadataandcreatedConversationIdMetadata-protocol: none
维护者速读
What changes
Framework ADR-0160 D6, seventh amendment ("The focus of a conversation"), on the client. Only where the agent declares
capabilities.focus: true; without it nothing changes (no chip, nofocuskey, the page chip where it was).{ focus, dismissed }(layout/chatFocus.ts, rewritten). A conversation with no id yet is about the page's record (surfaceRecord(), moved here from the row), unless dismissed, and follows the page with no prompt. The first send fixes it: the id that send's own create mints (useChatConversation's newcreatedConversationId) takes the focus it had at that moment, in the same render, so the first turn already carriescontext.focus. The mark keeps thecreatedConversationIdthe hook held when the send was made, and only a newer one takes it. No other arriving id takes it: a thread a send made during the resolve joins, and a history row opened while the create is on the wire, keep their own fixed or dismissed entry, including a thread this dock created at an earlier send. After that, navigation no longer moves it. A conversation sent without one never takes one.sessionStoragecopy first, else its row'smetadata.focus(cloud#5113 shape: an array likecontext.focus,raw[0]under a string object/id guard, label trimmed; the client applies no length cap and the chip truncates in CSS; absent or malformed means none).useChatConversationnow returnsconversationMetadata, themetadataof the row it holds, andcreatedConversationId, the row its own create minted last. The request body stays the authority.ChatbotEnhanced.promptInputHeaderSlot, new, drawn in place of thesurfaceContextLabelchip when given): object icon, record name (else the metadata label, elseobject · id), and ×. × shows on hover, on focus-within, always on a coarse pointer, and has a 24px hit area. Logical margins, so it sits on the right in RTL. With no focus the page chip 「正在看:X」 shows, with no ×.setChatFocuscallers are already gone with C1 (feat(spec)!: retire the ask_ai action type (ADR-0160 D7) #37924); this removes the pin, the 「改为问《X》?」 offer,declined, and the four locale keysconsole.ai.focus.pin/switchPrompt/switchAccept/switchDeclinefrom every pack (they shipped only in 19 prereleases; named on their own line in the changeset).console.ai.focus.pinnednow names the chip for assistive technology,.removelabels ×.ToolExecutionContext.focusdocblock and thecapabilities.focusdescription no longer speak of a pin; no key, type or gate change (protocol.mdxregenerated).Tests
layout/__tests__/chatFocus-36999.test.tsx, rewritten (25 cases):surfaceRecord;chatFocusFromMetadata(array, absent, malformed); the dock before the first send following the page, × before and after the send, a list start, a target change resetting ×; restore fromsessionStorage, from metadata in a new tab (with label), absent/malformed metadata, × in this tab beating metadata, a failed create; a send during the resolve joining a found thread that keeps its ×; a history row opened while the create is on the wire keeping its own focus; the same two paths on a thread this dock itself created earlier, keeping its ×; the × reachability classes; the full page (no record, metadata restore); no-capability agents; the no-flag frame chip.plugin-chatbot/__tests__/ChatbotEnhanced.promptInputHeaderSlot-37861.test.tsx(3): the slot sits inside the input group before the textarea and replaces the surface chip.i18n/__tests__/de-quote-pairing-3876.test.ts: count 129 to 128 for the removed key.Ablations (on disk, restored from the commit): metadata restore plus the unsent rule removed → 10 red; carry plus origin removed → 5 red;
markSendinga no-op → 5 red. At2a9ab800: the newer-than-at-send check removed → the two cases on a dock-created thread red (2 of 25); that check and the created-id match both removed → 4 of 25 red. The per-target epoch from the previous round is removed: the held send marks again after a target change, so no case could turn on it.Readings
37dccd4c(the second review fix2a9ab800, then main merged, 18 behind, no conflict): every test file under app-shelllayout,console/aiandhooks, plusplugin-chatbotandi18n: 505 files, 5413 passed, 13 skipped, 2 failed indesignModeMenuSave-36363under the shared box, as on every earlier head (it passed alone, 47/47, atfdb5e405). The diff does not touch design mode.pnpm run type-checkin@object-ui/app-shell,@object-ui/plugin-chatbotand@object-ui/i18n: exit 0 each, after building the dependency closure with declarations.chatFocus.tsanduseChatConversation.ts: 0 errors.chatFocus.tshas onereact-hooks/refswarning, for the first-send mark read where an id arrives (main had two in this file).overlap-check.mjsat37dccd4c: clean.dispatch-gates --ranat00f98e0c: 116 accounted, 115 run, 1 NOT-MEASURED (exit 3, built-output prerequisite).fdb5e405: 74 check runs, 0 failure.Acceptance notes
chatFocus.ts, its test andChatDockConversation.tsx(C1 had trimmed the same setter and carry code this rewrite replaces). The second main merge (00f98e0c) had no conflict. The file surface is unchanged from the claim.metadata.focusshows the page chip, not a focus: the server row is the only witness there.Verification
Read first, by risk:
ui/packages/app-shell/src/layout/chatFocus.ts:nextFocusState(which arrival of an id takes the first send's mark) anduseConversationFocus's effective focus.ui/packages/app-shell/src/hooks/useChatConversation.ts:heldMetadataand when it is set.ui/packages/app-shell/src/console/ai/ChatFocusRow.tsx: the chip and the × classes.Two-minute check:
pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/chatFocus-36999.test.tsx. Expected: 21 passed. In the Console, with an agent that declarescapabilities.focus: open a record, open 问 AI, the composer line starts with the record's chip; open another record, the chip follows; send, then navigate away, the chip stays.Generated by Claude Code