diff --git a/src/renderer/src/pages/home/Tabs/TopicsTab.tsx b/src/renderer/src/pages/home/Tabs/TopicsTab.tsx index d2fed14e03..2df5fb5db8 100644 --- a/src/renderer/src/pages/home/Tabs/TopicsTab.tsx +++ b/src/renderer/src/pages/home/Tabs/TopicsTab.tsx @@ -396,9 +396,46 @@ const Topics: FC = ({ assistant: _assistant, activeTopic, setActiveTopic onClick={() => onSwitchTopic(topic)} style={{ borderRadius }}> {isPending(topic.id) && !isActive && } - - {topicName} - + + + {topicName} + + {isActive && !topic.pinned && ( + +
+ {t('chat.topics.delete.shortcut', { key: isMac ? '⌘' : 'Ctrl' })} +
+ + }> + { + if (e.ctrlKey || e.metaKey) { + handleConfirmDelete(topic, e) + } else if (deletingTopicId === topic.id) { + handleConfirmDelete(topic, e) + } else { + handleDeleteClick(topic.id, e) + } + }}> + {deletingTopicId === topic.id ? ( + + ) : ( + + )} + +
+ )} + {topic.pinned && ( + + + + )} +
{topicPrompt && ( {fullTopicPrompt} @@ -407,37 +444,6 @@ const Topics: FC = ({ assistant: _assistant, activeTopic, setActiveTopic {showTopicTime && ( {dayjs(topic.createdAt).format('MM/DD HH:mm')} )} - {topic.pinned && } - {isActive && !topic.pinned && ( - -
- {t('chat.topics.delete.shortcut', { key: isMac ? '⌘' : 'Ctrl' })} -
- - }> - { - if (e.ctrlKey || e.metaKey) { - handleConfirmDelete(topic, e) - } else if (deletingTopicId === topic.id) { - handleConfirmDelete(topic, e) - } else { - handleDeleteClick(topic.id, e) - } - }}> - {deletingTopicId === topic.id ? ( - - ) : ( - - )} - -
- )} ) }} @@ -489,6 +495,14 @@ const TopicListItem = styled.div` } ` +const TopicNameContainer = styled.div` + display: flex; + flex-direction: row; + align-items: center; + gap: 4px; + justify-content: space-between; +` + const TopicName = styled.div` display: -webkit-box; -webkit-line-clamp: 1; @@ -532,11 +546,8 @@ const MenuButton = styled.div` flex-direction: row; justify-content: center; align-items: center; - min-width: 22px; - min-height: 22px; - position: absolute; - right: 8px; - top: 6px; + min-width: 20px; + min-height: 20px; .anticon { font-size: 12px; }