fix: 重置按钮放在头部,返回按钮的逻辑不变

This commit is contained in:
肖应宇 2026-05-07 10:34:53 +08:00
parent b7f2001914
commit cb56507767
5 changed files with 33 additions and 4 deletions

View File

@ -368,7 +368,14 @@ export default function ChatPage() {
variant="ghost"
className="px-[10px] py-[5px] text-sm font-medium text-ws-base-1 hover:text-ws-base-1/80"
disabled={isStreaming}
onClick={() => setShowExitDialog(true)}
onClick={() => {
sendToParent({
type: POST_MESSAGE_TYPES.IS_CHATTING,
isChatting: false,
});
router.replace(`/workspace/chats/${threadId}?is_chatting=false`)
}
}
>
<svg
width="20"
@ -424,6 +431,20 @@ export default function ChatPage() {
</Button>
}
/> */}
<Tooltip content={t.common.resetThread}>
<Button
size="sm"
variant="ghost"
className="h-full px-[10px] py-[5px] text-sm font-medium text-ws-base-1 hover:text-ws-base-1"
disabled={isStreaming}
onClick={() => setShowExitDialog(true)}
>
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
<path d="M2 4H6M16 4H12M6 4H12M6 4C6 2.89543 6.89543 2 8 2H10C11.1046 2 12 2.89543 12 4M4 6V14C4 15.1046 4.89543 16 6 16H12C13.1046 16 14 15.1046 14 14V6M7 8V13M11 8V13" stroke="#150033" stroke-linecap="round" />
</svg>
{t.common.resetThread}
</Button>
</Tooltip>
{artifacts?.length > 0 && !artifactsOpen && (
<Tooltip content={t.chatPage.viewArtifactsTooltip}>
@ -436,7 +457,12 @@ export default function ChatPage() {
setSidebarOpen(false);
}}
>
<FilesIcon />
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
<path d="M16 7V4C16 2.89543 15.1046 2 14 2H4C2.89543 2 2 2.89543 2 4V14C2 15.1046 2.89543 16 4 16H9" stroke="#150033" stroke-linecap="round" />
<path d="M5 5H9M5 8H7" stroke="#150033" stroke-linecap="round" stroke-linejoin="round" />
<circle cx="11.5" cy="10.5" r="3" stroke="#150033" />
<path d="M15.5 14.5L14 13" stroke="#150033" stroke-linecap="round" stroke-linejoin="round" />
</svg>
{t.common.artifacts}
</Button>
</Tooltip>

View File

@ -965,14 +965,14 @@ export function InputBox({
/>
</div>
)}
{!showWelcomeStyle && (
{/* {!showWelcomeStyle && (
<div className="shrink-0 h-full">
<ExitChattingButton
router={router}
threadId={threadIdFromProps}
/>
</div>
)}
)} */}
<div ref={attachmentsButtonTourRef} className="shrink-0 h-full">
<AddAttachmentsButton />
</div>

View File

@ -53,6 +53,7 @@ export const enUS: Translations = {
exportSuccess: "Conversation exported",
removeAttachment: "Remove attachment",
reference: "Reference",
resetThread: "Reset thread",
},
// Welcome

View File

@ -48,6 +48,7 @@ export interface Translations {
exportSuccess: string;
removeAttachment: string;
reference: string;
resetThread: string;
};
// Welcome

View File

@ -55,6 +55,7 @@ export const zhCN: Translations = {
exportSuccess: "对话已导出",
removeAttachment: "移除附件",
reference: "引用",
resetThread: "重置会话",
},
// Welcome