fix: resolve conflicts (#617)

This commit is contained in:
Puzhen Zhang 2025-11-06 10:42:26 +01:00 committed by GitHub
commit 6bfdac24c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 1 deletions

View file

@ -40,7 +40,25 @@ export const UserQueryGroup: React.FC<UserQueryGroupProps> = ({
// Show task if this query group has a task message OR if it's the most recent user query during splitting
// During splitting phase (no to_sub_tasks yet), show task for the most recent query only
// Exclude human-reply scenarios (when user is replying to an activeAsk)
const isHumanReply = queryGroup.userMessage &&
activeTaskId &&
chatState.tasks[activeTaskId] &&
(chatState.tasks[activeTaskId].activeAsk ||
// Check if this user message follows an 'ask' message in the message sequence
(() => {
const messages = chatState.tasks[activeTaskId].messages;
const userMessageIndex = messages.findIndex((m: any) => m.id === queryGroup.userMessage.id);
if (userMessageIndex > 0) {
// Check the previous message - if it's an agent message with step 'ask', this is a human-reply
const prevMessage = messages[userMessageIndex - 1];
return prevMessage?.role === 'agent' && prevMessage?.step === 'ask';
}
return false;
})());
const isLastUserQuery = !queryGroup.taskMessage &&
!isHumanReply &&
activeTaskId &&
chatState.tasks[activeTaskId] &&
queryGroup.userMessage &&
@ -151,7 +169,7 @@ export const UserQueryGroup: React.FC<UserQueryGroupProps> = ({
</motion.div>
{/* Sticky Task Box - Show only when task exists and NOT in skeleton phase */}
{task && !isSkeletonPhase && (
{task && !isSkeletonPhase && !isHumanReply && (
<motion.div
ref={taskBoxRef}
className="sticky top-0 z-20"