🐛 fix(topic): correct topic item href route for agent and group pages (#11607)

- Change agent topic href from `/chat?agent=xxx&topic=xxx` to `/agent/xxx?topic=xxx`
- Change group topic href from `/group/xxx?topic=xxx` format using urlJoin to direct template literal
- Remove unused urlJoin import

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Arvin Xu
2026-01-20 20:06:43 +08:00
committed by GitHub
parent 600cb85001
commit 2fffe8b6ee
2 changed files with 2 additions and 4 deletions

View File

@@ -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) => [

View File

@@ -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) => [