From 32d6c2e1d896f7ab90ea61565c64c75b401ae730 Mon Sep 17 00:00:00 2001 From: Wang Jiyuan <59059173+EurFelux@users.noreply.github.com> Date: Mon, 23 Jun 2025 09:59:50 +0800 Subject: [PATCH] feat(TopicsTab): Allow deletion of inactive topics (#7415) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(主题列表): 修复主题列表项悬停样式和菜单显示条件 调整主题列表项悬停时的背景色过渡效果,并修正菜单显示逻辑,仅在非挂起状态显示 * fix(TopicsTab): 移除话题待处理状态检查 * fix(TopicsTab): 修复删除话题时未检查当前活跃话题的问题 --- src/renderer/src/pages/home/Tabs/TopicsTab.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/pages/home/Tabs/TopicsTab.tsx b/src/renderer/src/pages/home/Tabs/TopicsTab.tsx index 6d370484fb..01a548b8c1 100644 --- a/src/renderer/src/pages/home/Tabs/TopicsTab.tsx +++ b/src/renderer/src/pages/home/Tabs/TopicsTab.tsx @@ -127,11 +127,13 @@ const Topics: FC = ({ assistant: _assistant, activeTopic, setActiveTopic } await modelGenerating() const index = findIndex(assistant.topics, (t) => t.id === topic.id) - setActiveTopic(assistant.topics[index + 1 === assistant.topics.length ? index - 1 : index + 1]) + if (topic.id === activeTopic.id) { + setActiveTopic(assistant.topics[index + 1 === assistant.topics.length ? index - 1 : index + 1]) + } removeTopic(topic) setDeletingTopicId(null) }, - [assistant.topics, onClearMessages, removeTopic, setActiveTopic] + [activeTopic.id, assistant.topics, onClearMessages, removeTopic, setActiveTopic] ) const onPinTopic = useCallback( @@ -471,7 +473,7 @@ const Topics: FC = ({ assistant: _assistant, activeTopic, setActiveTopic {topicName} - {isActive && !topic.pinned && ( + {!topic.pinned && (