feat: Add direct topic deletion shortcut
This commit is contained in:
parent
3a936e0f26
commit
0d236a94ab
@ -140,6 +140,7 @@
|
||||
"topics.title": "Topics",
|
||||
"topics.unpinned": "Unpinned Topics",
|
||||
"topics.delete.title": "Are you sure you want to delete this topic? This action cannot be undone",
|
||||
"topics.delete.shortcut": "Hold {{key}} to delete directly",
|
||||
"translate": "Translate",
|
||||
"topics.prompt": "Topic Prompts",
|
||||
"topics.prompt.tips": "Topic Prompts: Additional supplementary prompts provided for the current topic",
|
||||
|
||||
@ -140,6 +140,7 @@
|
||||
"topics.title": "トピック",
|
||||
"topics.unpinned": "固定解除",
|
||||
"topics.delete.title": "このトピックを削除してもよろしいですか?この操作は元に戻せません",
|
||||
"topics.delete.shortcut": "{{key}}キーを押しながらで直接削除",
|
||||
"translate": "翻訳",
|
||||
"topics.prompt": "トピック提示語",
|
||||
"topics.prompt.tips": "トピック提示語:現在のトピックに対して追加の補足提示語を提供",
|
||||
|
||||
@ -140,6 +140,7 @@
|
||||
"topics.title": "Топики",
|
||||
"topics.unpinned": "Открепленные темы",
|
||||
"topics.delete.title": "Вы уверены, что хотите удалить этот топик? Это действие нельзя отменить",
|
||||
"topics.delete.shortcut": "Удерживайте {{key}} для мгновенного удаления",
|
||||
"translate": "Перевести",
|
||||
"topics.prompt": "Тематические подсказки",
|
||||
"topics.prompt.tips": "Тематические подсказки: Дополнительные подсказки, предоставленные для текущей темы",
|
||||
|
||||
@ -142,10 +142,10 @@
|
||||
"topics.title": "话题",
|
||||
"topics.unpinned": "取消固定",
|
||||
"topics.delete.title": "确定要删除此话题吗?此操作无法撤销",
|
||||
"topics.delete.shortcut": "按住 {{key}} 可直接删除",
|
||||
"translate": "翻译",
|
||||
"topics.prompt": "话题提示词",
|
||||
"topics.prompt.tips": "话题提示词: 针对当前话题提供额外的补充提示词",
|
||||
"topics.prompt.edit.title": "编辑话题提示词"
|
||||
"topics.prompt.tips": "话题提示词: 针对当前话题提供额外的补充提示词"
|
||||
},
|
||||
"common": {
|
||||
"add": "添加",
|
||||
|
||||
@ -140,6 +140,7 @@
|
||||
"topics.title": "話題",
|
||||
"topics.unpinned": "取消固定",
|
||||
"topics.delete.title": "確定要刪除此話題嗎?此操作無法撤銷",
|
||||
"topics.delete.shortcut": "按住 {{key}} 可直接刪除",
|
||||
"translate": "翻譯",
|
||||
"topics.prompt": "話題提示詞",
|
||||
"topics.prompt.tips": "話題提示詞:針對目前話題提供額外的補充提示詞",
|
||||
|
||||
@ -11,6 +11,7 @@ import {
|
||||
import DragableList from '@renderer/components/DragableList'
|
||||
import PromptPopup from '@renderer/components/Popups/PromptPopup'
|
||||
import Scrollbar from '@renderer/components/Scrollbar'
|
||||
import { isMac } from '@renderer/config/constant'
|
||||
import { useAssistant, useAssistants } from '@renderer/hooks/useAssistant'
|
||||
import { modelGenerating } from '@renderer/hooks/useRuntime'
|
||||
import { useSettings } from '@renderer/hooks/useSettings'
|
||||
@ -260,16 +261,37 @@ const Topics: FC<Props> = ({ assistant: _assistant, activeTopic, setActiveTopic
|
||||
removeTopic(topic)
|
||||
}}
|
||||
onCancel={(e) => e?.stopPropagation()}>
|
||||
<MenuButton
|
||||
className="menu"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
if (assistant.topics.length === 1) {
|
||||
return onClearMessages()
|
||||
}
|
||||
}}>
|
||||
<CloseOutlined />
|
||||
</MenuButton>
|
||||
<Tooltip
|
||||
placement="bottom"
|
||||
mouseEnterDelay={0.7}
|
||||
title={
|
||||
<div>
|
||||
<div style={{ fontSize: '12px', opacity: 0.8, fontStyle: 'italic' }}>
|
||||
{t('chat.topics.delete.shortcut', {
|
||||
key: isMac ? '⌘' : 'Ctrl'
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
}>
|
||||
<MenuButton
|
||||
className="menu"
|
||||
onClick={async (e) => {
|
||||
e.stopPropagation()
|
||||
if (assistant.topics.length === 1) {
|
||||
return onClearMessages()
|
||||
}
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
await modelGenerating()
|
||||
const index = findIndex(assistant.topics, (t) => t.id === topic.id)
|
||||
setActiveTopic(
|
||||
assistant.topics[index + 1 === assistant.topics.length ? index - 1 : index + 1]
|
||||
)
|
||||
removeTopic(topic)
|
||||
}
|
||||
}}>
|
||||
<CloseOutlined />
|
||||
</MenuButton>
|
||||
</Tooltip>
|
||||
</Popconfirm>
|
||||
)}
|
||||
</TopicListItem>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user