Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
feat: clearing convos requires confirmation
Daniel Avila0a671849b5d0
diff --git a/client/src/components/Main/TextChat.jsx b/client/src/components/Main/TextChat.jsxindex 4cf6e8799c..3b62132f51 100644--- a/client/src/components/Main/TextChat.jsx+++ b/client/src/components/Main/TextChat.jsx@@ -247,7 +247,6 @@ export default function TextChat({ messages }) {} else {let text = data.text || data.response;if (data.initial) {- console.log(data);dispatch(toggleCursor());}if (data.message) {diff --git a/client/src/components/Messages/index.jsx b/client/src/components/Messages/index.jsxindex 030e607941..2b3309ce56 100644--- a/client/src/components/Messages/index.jsx+++ b/client/src/components/Messages/index.jsx@@ -36,7 +36,6 @@ export default function Messages({ messages, messageTree }) {}, [messages]);const scrollToBottom = useCallback(throttle(() => {- console.log('scrollToBottom');messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });setShowScrollButton(false);}, 750, { leading: true }), [messagesEndRef]);diff --git a/client/src/components/Nav/ClearConvos.jsx b/client/src/components/Nav/ClearConvos.jsxindex c9a9b379ba..9f019765dc 100644--- a/client/src/components/Nav/ClearConvos.jsx+++ b/client/src/components/Nav/ClearConvos.jsx@@ -6,6 +6,8 @@ import { useDispatch } from 'react-redux';import { setNewConvo, removeAll } from '~/store/convoSlice';import { setMessages } from '~/store/messageSlice';import { setSubmission } from '~/store/submitSlice';+import { Dialog, DialogTrigger } from '../ui/Dialog.tsx';+import DialogTemplate from '../ui/DialogTemplate';export default function ClearConvos() {const dispatch = useDispatch();@@ -25,12 +27,25 @@ export default function ClearConvos() {};return (+ <Dialog>+ <DialogTrigger asChild><aclassName="flex cursor-pointer items-center gap-3 rounded-md py-3 px-3 text-sm text-white transition-colors duration-200 hover:bg-gray-500/10"- onClick={clickHandler}+ // onClick={clickHandler}><TrashIcon />Clear conversations</a>+ </DialogTrigger>+ <DialogTemplate+ title="Clear conversations"+ description="Are you sure you want to clear all conversations? This is irreversible."+ selection={{+ selectHandler: clickHandler,+ selectClasses: 'bg-red-600 hover:bg-red-700 dark:hover:bg-red-800 text-white',+ selectText: 'Clear',+ }}+ />+ </Dialog>);}diff --git a/client/src/components/ui/DialogTemplate.jsx b/client/src/components/ui/DialogTemplate.jsxnew file mode 100644index 0000000000..63c19d4fb3--- /dev/null+++ b/client/src/components/ui/DialogTemplate.jsx@@ -0,0 +1,57 @@+import React from 'react';++import {+ DialogClose,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle+} from './Dialog.tsx';++export default function DialogTemplate({ title, description, main, buttons, selection }) {+ const { selectHandler, selectClasses, selectText } = selection;++ const defaultSelect = "bg-gray-900 text-white transition-colors hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-gray-100 dark:text-gray-900 dark:hover:bg-gray-200 dark:focus:ring-gray-400 dark:focus:ring-offset-gray-900"+ return (+ <DialogContent className="shadow-2xl dark:bg-gray-800">+ <DialogHeader>+ <DialogTitle className="text-gray-800 dark:text-white">{title}</DialogTitle>+ <DialogDescription className="text-gray-600 dark:text-gray-300">+ {description}+ </DialogDescription>+ </DialogHeader>+ {/* <div className="grid gap-4 py-4">+ <div className="grid grid-cols-4 items-center gap-4"> //input template++ </div>+ <div className="grid grid-cols-4 items-center gap-4">+ <Label+ htmlFor="promptPrefix"+ className="text-right"+ >+ Prompt Prefix+ </Label>+ <TextareaAutosize+ id="promptPrefix"+ value={promptPrefix}+ onChange={(e) => setPromptPrefix(e.target.value)}+ placeholder="Set custom instructions. Defaults to: 'You are ChatGPT, a large language model trained by OpenAI.'"+ className="col-span-3 flex h-20 w-full resize-none rounded-md border border-gray-300 bg-transparent py-2 px-3 text-sm shadow-[0_0_10px_rgba(0,0,0,0.10)] outline-none placeholder:text-gray-400 focus:outline-none focus:ring-gray-400 focus:ring-opacity-20 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-none dark:bg-gray-700 dark:text-gray-50 dark:shadow-[0_0_15px_rgba(0,0,0,0.10)] dark:focus:border-none dark:focus:border-transparent dark:focus:outline-none dark:focus:ring-0 dark:focus:ring-gray-400 dark:focus:ring-offset-0"+ />+ </div>+ </div> */}+ {main ? main : null}+ <DialogFooter>+ <DialogClose className="dark:hover:gray-400 border-gray-700">Cancel</DialogClose>+ { buttons ? buttons : null}+ <DialogClose+ onClick={selectHandler}+ className={`${selectClasses || defaultSelect} inline-flex h-10 items-center justify-center rounded-md border-none py-2 px-4 text-sm font-semibold`}+ >+ {selectText}+ </DialogClose>+ </DialogFooter>+ </DialogContent>+ );+}