fix(rectification): hold time cards until an offer turn
Keep collecting while a method follow-up can still distinguish candidates, and show adoption cards only after offer-candidates. Align the natal house snapshot with the agent text column. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -126,6 +126,10 @@ type RenderMessage = ChatMessageView & {
|
||||
turnId?: string;
|
||||
};
|
||||
|
||||
function turnOfferedSelection(message: RenderMessage): boolean {
|
||||
return Boolean(message.completedReceipt?.steps.includes("rectification-offer-candidates"));
|
||||
}
|
||||
|
||||
function completedReceiptFromPersisted(receipt: PersistedTurn["receipt"]): CompletedActivityReceiptView {
|
||||
if (!receipt) return { steps: [], methods: [] };
|
||||
if (Array.isArray(receipt.tool_activities)) {
|
||||
@@ -552,13 +556,15 @@ export function RectificationAgenticChat(props: RectificationAgenticChatProps) {
|
||||
&& message.state === "settled"
|
||||
&& !message.failed
|
||||
&& Boolean(message.text)
|
||||
))?.renderKey;
|
||||
));
|
||||
const showSelectionCards = Boolean(
|
||||
candidateResult?.selectionAllowed
|
||||
&& latestOfferMessageKey
|
||||
&& turnOfferedSelection(latestOfferMessageKey)
|
||||
&& !busy
|
||||
&& regeneratingMessageKey === null,
|
||||
);
|
||||
const selectionCardMessageKey = showSelectionCards ? latestOfferMessageKey.renderKey : undefined;
|
||||
const canSend = !busy && !readonly && !regeneratingMessageKey;
|
||||
|
||||
return (
|
||||
@@ -613,7 +619,7 @@ export function RectificationAgenticChat(props: RectificationAgenticChatProps) {
|
||||
onRegenerate={() => void regenerateMessage(message)}
|
||||
/>
|
||||
)}
|
||||
{showSelectionCards && message.renderKey === latestOfferMessageKey && candidateResult && (
|
||||
{showSelectionCards && message.renderKey === selectionCardMessageKey && candidateResult && (
|
||||
<RectificationCandidateCards
|
||||
result={candidateResult}
|
||||
acceptingCandidateId={acceptingCandidateId}
|
||||
|
||||
Reference in New Issue
Block a user