From 2b5fbb7f1870c722dac474fc6d465f7552d4f385 Mon Sep 17 00:00:00 2001 From: Reekin Date: Mon, 18 Mar 2024 05:17:55 +0800 Subject: [PATCH] Add Quick NewChat Action --- app/components/chat.tsx | 18 ++++++++++++++++-- app/locales/cn.ts | 1 + app/locales/en.ts | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index bcd0e605d..99e3e2d94 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -37,6 +37,7 @@ import AutoIcon from "../icons/auto.svg"; import BottomIcon from "../icons/bottom.svg"; import StopIcon from "../icons/pause.svg"; import RobotIcon from "../icons/robot.svg"; +import AddIcon from "../icons/add.svg"; import { ChatMessage, @@ -97,6 +98,8 @@ import { ExportMessageModal } from "./exporter"; import { getClientConfig } from "../config/client"; import { useAllModels } from "../utils/hooks"; import { MultimodalContent } from "../client/api"; +import { InputRange } from "./input-range"; +import { config } from "process"; const Markdown = dynamic(async () => (await import("./markdown")).Markdown, { loading: () => , @@ -555,6 +558,15 @@ export function ChatActions(props: { icon={} /> + } + onClick={() => { + chatStore.newSession(chatStore.currentSession().mask); + navigate(Path.Chat); + }} + /> + {showModelSelector && ( ) => { const currentModel = chatStore.currentSession().mask.modelConfig.model; - if(!isVisionModel(currentModel)){return;} + if (!isVisionModel(currentModel)) { + return; + } const items = (event.clipboardData || window.clipboardData).items; for (const item of items) { if (item.kind === "file" && item.type.startsWith("image/")) { diff --git a/app/locales/cn.ts b/app/locales/cn.ts index 5d0c28428..491774efe 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -62,6 +62,7 @@ const cn = { Prompt: "快捷指令", Masks: "所有面具", Clear: "清除聊天", + NewChat: "另起聊天", Settings: "对话设置", UploadImage: "上传图片", }, diff --git a/app/locales/en.ts b/app/locales/en.ts index 79a91d7cc..129ca95e5 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -64,6 +64,7 @@ const en: LocaleType = { Prompt: "Prompts", Masks: "Masks", Clear: "Clear Context", + NewChat: "New Chat", Settings: "Settings", UploadImage: "Upload Images", },