Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 fix(task): task-callback opens the side portal instead of navigating away (#16316)

Arvin Xud860e1e909a4
diff --git a/src/features/Conversation/Messages/TaskCallback/index.tsx b/src/features/Conversation/Messages/TaskCallback/index.tsx
index a021b3b6199..6bba032a950 100644
--- a/src/features/Conversation/Messages/TaskCallback/index.tsx
+++ b/src/features/Conversation/Messages/TaskCallback/index.tsx
@@ -7,7 +7,7 @@ import { CircleAlert, CircleCheck, CircleSlash, SquareArrowOutUpRight } from 'lu
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import { useNavigateToTaskDetail } from '@/features/AgentTasks/shared/taskDetailPath';
+import { useChatStore } from '@/store/chat';
import { dataSelectors, useConversationStore } from '../../store';
@@ -58,7 +58,9 @@ const reasonMeta: Record<
const TaskCallbackMessage = memo<TaskCallbackMessageProps>(({ id }) => {
const { styles, theme } = useStyles();
const { t } = useTranslation('chat');
- const navigateToTask = useNavigateToTaskDetail();
+ // Open the task in the right-side detail portal (in-context), instead of
+ // navigating away from the conversation to the full task page.
+ const openTaskDetail = useChatStore((s) => s.openTaskDetail);
const item = useConversationStore(dataSelectors.getDisplayMessageById(id), isEqual);
const callback = item?.metadata?.taskCallback;
@@ -81,7 +83,7 @@ const TaskCallbackMessage = memo<TaskCallbackMessageProps>(({ id }) => {
icon={SquareArrowOutUpRight}
size={'small'}
type={'text'}
- onClick={() => navigateToTask(callback.taskId)}
+ onClick={() => openTaskDetail(callback.identifier)}
>
{t('taskCallback.viewTask')}
</Button>