Skip to content

Commit 63e4b3d

Browse files
authored
πŸ’„ style: Add hyperlink to each topic & pinned agent (#10367)
* ✨ feat: refactor TopicItem to use Link for navigation and improve URL handling * πŸ› fix: remove enabled property from Gemini 3 Pro model definition * ✨ feat: add link to session chat in pinned agent list
1 parent 27c1154 commit 63e4b3d

File tree

3 files changed

+53
-33
lines changed
  • packages/model-bank/src/aiModels
  • src/app/[variants]/(main)
    • chat/components/topic/features/Topic/TopicListContent/TopicItem
    • layouts/desktop/SideBar/PinList

3 files changed

+53
-33
lines changed

β€Žpackages/model-bank/src/aiModels/ollamacloud.tsβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const ollamaCloudModels: AIChatModelCard[] = [
2323
description:
2424
'Gemini 3 Pro 是 Google ζœ€ζ™Ίθƒ½ηš„ζ¨‘εž‹οΌŒε…·ζœ‰ SOTA ζŽ¨η†ε’Œε€šζ¨‘εΌη†θ§£οΌŒδ»₯εŠεΌΊε€§ηš„δ»£η†ε’Œζ°›ε›΄ηΌ–η εŠŸθƒ½γ€‚',
2525
displayName: 'Gemini 3 Pro Preview',
26-
enabled: true,
2726
id: 'gemini-3-pro-preview',
2827
releasedAt: '2025-11-20',
2928
type: 'chat',

β€Žsrc/app/[variants]/(main)/chat/components/topic/features/Topic/TopicListContent/TopicItem/index.tsxβ€Ž

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { Skeleton } from 'antd';
22
import { createStyles } from 'antd-style';
3+
import qs from 'query-string';
34
import { Suspense, memo, useState } from 'react';
45
import { Flexbox } from 'react-layout-kit';
6+
import { Link } from 'react-router-dom';
57

68
import { useChatStore } from '@/store/chat';
79
import { useGlobalStore } from '@/store/global';
10+
import { useSessionStore } from '@/store/session';
811

912
import ThreadList from '../ThreadList';
1013
import DefaultContent from './DefaultContent';
@@ -52,32 +55,43 @@ const TopicItem = memo<ConfigCellProps>(({ title, active, id, fav, threadId }) =
5255
const { styles, cx } = useStyles();
5356
const toggleConfig = useGlobalStore((s) => s.toggleMobileTopic);
5457
const [toggleTopic] = useChatStore((s) => [s.switchTopic]);
58+
const activeId = useSessionStore((s) => s.activeId);
5559
const [isHover, setHovering] = useState(false);
5660

61+
const topicUrl = qs.stringifyUrl({
62+
query: id ? { session: activeId, topic: id } : { session: activeId },
63+
url: '/chat',
64+
});
65+
5766
return (
5867
<Flexbox style={{ position: 'relative' }}>
59-
<Flexbox
60-
align={'center'}
61-
className={cx(styles.container, 'topic-item', active && !threadId && styles.active)}
62-
distribution={'space-between'}
63-
horizontal
64-
onClick={() => {
68+
<Link
69+
onClick={(e) => {
70+
e.preventDefault();
6571
toggleTopic(id);
6672
toggleConfig(false);
6773
}}
68-
onMouseEnter={() => {
69-
setHovering(true);
70-
}}
71-
onMouseLeave={() => {
72-
setHovering(false);
73-
}}
74+
to={topicUrl}
7475
>
75-
{!id ? (
76-
<DefaultContent />
77-
) : (
78-
<TopicContent fav={fav} id={id} showMore={isHover} title={title} />
79-
)}
80-
</Flexbox>
76+
<Flexbox
77+
align={'center'}
78+
className={cx(styles.container, 'topic-item', active && !threadId && styles.active)}
79+
distribution={'space-between'}
80+
horizontal
81+
onMouseEnter={() => {
82+
setHovering(true);
83+
}}
84+
onMouseLeave={() => {
85+
setHovering(false);
86+
}}
87+
>
88+
{!id ? (
89+
<DefaultContent />
90+
) : (
91+
<TopicContent fav={fav} id={id} showMore={isHover} title={title} />
92+
)}
93+
</Flexbox>
94+
</Link>
8195
{active && (
8296
<Suspense
8397
fallback={

β€Žsrc/app/[variants]/(main)/layouts/desktop/SideBar/PinList/index.tsxβ€Ž

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { Divider } from 'antd';
33
import { createStyles } from 'antd-style';
44
import isEqual from 'fast-deep-equal';
55
import { Flexbox } from 'react-layout-kit';
6+
import { Link } from 'react-router-dom';
67

8+
import { SESSION_CHAT_URL } from '@/const/url';
79
import { usePinnedAgentState } from '@/hooks/usePinnedAgentState';
810
import { useSwitchSession } from '@/hooks/useSwitchSession';
911
import { useSessionStore } from '@/store/session';
@@ -93,21 +95,26 @@ const PinList = () => {
9395
placement={'right'}
9496
title={sessionHelpers.getTitle(item.meta)}
9597
>
96-
<Flexbox
97-
className={cx(
98-
styles.ink,
99-
isPinned && activeId === item.id ? styles.inkActive : undefined,
100-
)}
98+
<Link
99+
onClick={(e) => {
100+
e.preventDefault();
101+
switchAgent(item.id);
102+
}}
103+
to={SESSION_CHAT_URL(item.id)}
101104
>
102-
<Avatar
103-
avatar={sessionHelpers.getAvatar(item.meta)}
104-
background={item.meta.backgroundColor}
105-
onClick={() => {
106-
switchAgent(item.id);
107-
}}
108-
size={40}
109-
/>
110-
</Flexbox>
105+
<Flexbox
106+
className={cx(
107+
styles.ink,
108+
isPinned && activeId === item.id ? styles.inkActive : undefined,
109+
)}
110+
>
111+
<Avatar
112+
avatar={sessionHelpers.getAvatar(item.meta)}
113+
background={item.meta.backgroundColor}
114+
size={40}
115+
/>
116+
</Flexbox>
117+
</Link>
111118
</Tooltip>
112119
</Flexbox>
113120
))}

0 commit comments

Comments
Β (0)