feat(studio): 回退/重roll 与 R5 用户确认下一步

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-31 22:27:25 +08:00
parent f3792915a3
commit 63a32bfa7c
8 changed files with 613 additions and 82 deletions

View File

@@ -49,17 +49,15 @@ function StudioRunChat({
const lastUserIdx = findLastUserMessageIndex(stepMessages);
const historyMessages =
lastUserIdx > 0 ? stepMessages.slice(0, lastUserIdx) : [];
lastUserIdx > 0
? stepMessages.slice(0, lastUserIdx).filter((msg) => msg.role === 'user')
: [];
const lastUserMessage =
lastUserIdx >= 0 ? stepMessages[lastUserIdx] : pendingUserText
? { role: 'user', content: pendingUserText }
: null;
const summaryText =
evaluation ||
(lastUserIdx >= 0 && stepMessages[lastUserIdx + 1]?.role === 'assistant'
? stepMessages[lastUserIdx + 1].content
: null);
const summaryText = evaluation || null;
const hasFocusContent =
thinking || summaryText || pendingUserText || sending || lastUserMessage;
@@ -124,11 +122,9 @@ function StudioRunChat({
{historyMessages.map((msg) => (
<div
key={msg.id}
className={`studio-run-chat-history-item role-${msg.role}`}
className="studio-run-chat-history-item role-user"
>
<span className="studio-run-chat-history-role">
{msg.role === 'user' ? '你' : '助手'}
</span>
<span className="studio-run-chat-history-role"></span>
<span className="studio-run-chat-history-text">{msg.content}</span>
</div>
))}