fix(rectification): place completion receipt above reply
This commit is contained in:
@@ -423,6 +423,9 @@ export function RectificationAgenticChat(props: RectificationAgenticChatProps) {
|
||||
)}
|
||||
{messages.map((message) => (
|
||||
<div key={message.renderKey} className="rectification-message-wrap">
|
||||
{message.state === "settled" && message.completedReceipt && (
|
||||
<CompletedActivityReceipt receipt={message.completedReceipt} />
|
||||
)}
|
||||
<ChatMessageRow
|
||||
message={{
|
||||
...message,
|
||||
@@ -432,9 +435,6 @@ export function RectificationAgenticChat(props: RectificationAgenticChatProps) {
|
||||
}}
|
||||
showActivity={message.state === "thinking" || Boolean(message.activeActivity)}
|
||||
/>
|
||||
{message.state === "settled" && message.completedReceipt && (
|
||||
<CompletedActivityReceipt receipt={message.completedReceipt} />
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
{candidateResult?.selectionAllowed && candidateResult.candidates.length > 0 && (
|
||||
|
||||
@@ -181,7 +181,7 @@ test("Agentic rectification scrolls the conversation container as streamed messa
|
||||
assert.doesNotMatch(chat, /conversationEnd|scrollIntoView/);
|
||||
});
|
||||
|
||||
test("rectification activity separates live work from the receipt below the Agent message", () => {
|
||||
test("rectification activity separates live work from the receipt above the Agent message", () => {
|
||||
const activityHelper = chat.slice(
|
||||
chat.indexOf("function completedReceiptFromPersisted"),
|
||||
chat.indexOf("export function RectificationAgenticChat"),
|
||||
@@ -204,7 +204,7 @@ test("rectification activity separates live work from the receipt below the Agen
|
||||
chat.indexOf('{messages.map((message) => ('),
|
||||
chat.indexOf('{candidateResult?.selectionAllowed'),
|
||||
);
|
||||
assert.ok(messageRender.indexOf("<ChatMessageRow") < messageRender.indexOf("<CompletedActivityReceipt"));
|
||||
assert.ok(messageRender.indexOf("<CompletedActivityReceipt") < messageRender.indexOf("<ChatMessageRow"));
|
||||
assert.match(completedActivityReceipt, /<details className=/);
|
||||
assert.doesNotMatch(completedActivityReceipt, /<details[^>]*\sopen/);
|
||||
assert.match(completedActivityReceipt, /本轮完成 · \$\{stepLabels\.length\} 个步骤 · \$\{receipt\.methods\.length\} 项计算依据/);
|
||||
|
||||
Reference in New Issue
Block a user