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(topic): correct topic item href route for agent and group pages (#11607)

Arvin Xu2fffe8b6ee32
diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/index.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/index.tsx
index 2b742a7d527..b8eeed77294 100644
--- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/index.tsx
+++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/index.tsx
@@ -3,7 +3,6 @@ import { cssVar } from 'antd-style';
import { MessageSquareDashed, Star } from 'lucide-react';
import { Suspense, memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-import urlJoin from 'url-join';
import { isDesktop } from '@/const/version';
import NavItem from '@/features/NavPanel/components/NavItem';
@@ -33,7 +32,7 @@ const TopicItem = memo<TopicItemProps>(({ id, title, fav, active, threadId }) =>
// Construct href for cmd+click support
const href = useMemo(() => {
if (!activeAgentId || !id) return undefined;
- return urlJoin('/chat', `?agent=${activeAgentId}&topic=${id}`);
+ return `/agent/${activeAgentId}?topic=${id}`;
}, [activeAgentId, id]);
const [editing, isLoading] = useChatStore((s) => [
diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/index.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/index.tsx
index f294bc4ee7b..326b4293c68 100644
--- a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/index.tsx
+++ b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/index.tsx
@@ -3,7 +3,6 @@ import { cssVar } from 'antd-style';
import { MessageSquareDashed, Star } from 'lucide-react';
import { Suspense, memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-import urlJoin from 'url-join';
import { isDesktop } from '@/const/version';
import NavItem from '@/features/NavPanel/components/NavItem';
@@ -35,7 +34,7 @@ const TopicItem = memo<TopicItemProps>(({ id, title, fav, active, threadId }) =>
// Construct href for cmd+click support
const href = useMemo(() => {
if (!activeGroupId || !id) return undefined;
- return urlJoin('/group', activeGroupId, `?topic=${id}`);
+ return `/group/${activeGroupId}?topic=${id}`;
}, [activeGroupId, id]);
const [editing, isLoading] = useChatStore((s) => [