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: Add Default Temporary Chat User Setting (#10731)
Marco Berettaa725fb34dab8
diff --git a/client/src/components/Nav/SettingsTabs/Chat/Chat.tsx b/client/src/components/Nav/SettingsTabs/Chat/Chat.tsxindex 5c703922fc..fe36c52f85 100644--- a/client/src/components/Nav/SettingsTabs/Chat/Chat.tsx+++ b/client/src/components/Nav/SettingsTabs/Chat/Chat.tsx@@ -77,6 +77,13 @@ const toggleSwitchConfigs = [hoverCardText: undefined,key: 'modularChat',},+ {+ stateAtom: store.defaultTemporaryChat,+ localizationKey: 'com_nav_default_temporary_chat',+ switchId: 'defaultTemporaryChat',+ hoverCardText: 'com_nav_info_default_temporary_chat',+ key: 'defaultTemporaryChat',+ },];function Chat() {diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.jsonindex 3aa64da011..6f1890154f 100644--- a/client/src/locales/en/translation.json+++ b/client/src/locales/en/translation.json@@ -447,6 +447,7 @@"com_nav_conversation_mode": "Conversation Mode","com_nav_convo_menu_options": "Conversation Menu Options","com_nav_db_sensitivity": "Decibel sensitivity",+ "com_nav_default_temporary_chat": "Temporary Chat by default","com_nav_delete_account": "Delete account","com_nav_delete_account_button": "Permanently delete my account","com_nav_delete_account_confirm": "Delete account - are you sure?",@@ -480,6 +481,7 @@"com_nav_info_code_artifacts": "Enables the display of experimental code artifacts next to the chat","com_nav_info_code_artifacts_agent": "Enables the use of code artifacts for this agent. By default, additional instructions specific to the use of artifacts are added, unless \"Custom Prompt Mode\" is enabled.","com_nav_info_custom_prompt_mode": "When enabled, the default artifacts system prompt will not be included. All artifact-generating instructions must be provided manually in this mode.",+ "com_nav_info_default_temporary_chat": "When enabled, new chats will start with temporary chat mode activated by default. Temporary chats are not saved to your history.","com_nav_info_enter_to_send": "When enabled, pressing `ENTER` will send your message. When disabled, pressing Enter will add a new line, and you'll need to press `CTRL + ENTER` / `⌘ + ENTER` to send your message.","com_nav_info_fork_change_default": "`Visible messages only` includes just the direct path to the selected message. `Include related branches` adds branches along the path. `Include all to/from here` includes all connected messages and branches.","com_nav_info_fork_split_target_setting": "When enabled, forking will commence from the target message to the latest message in the conversation, according to the behavior selected.",diff --git a/client/src/routes/ChatRoute.tsx b/client/src/routes/ChatRoute.tsxindex 240b5583b9..72433bca46 100644--- a/client/src/routes/ChatRoute.tsx+++ b/client/src/routes/ChatRoute.tsx@@ -1,6 +1,7 @@import { useEffect } from 'react';import { Spinner } from '@librechat/client';import { useParams } from 'react-router-dom';+import { useRecoilCallback, useRecoilValue } from 'recoil';import { Constants, EModelEndpoint } from 'librechat-data-provider';import { useGetModelsQuery } from 'librechat-data-provider/react-query';import type { TPreset } from 'librechat-data-provider';@@ -11,13 +12,13 @@ import { ToolCallsMapProvider } from '~/Providers';import ChatView from '~/components/Chat/ChatView';import useAuthRedirect from './useAuthRedirect';import temporaryStore from '~/store/temporary';-import { useRecoilCallback } from 'recoil';import store from '~/store';export default function ChatRoute() {const { data: startupConfig } = useGetStartupConfig();const { isAuthenticated, user } = useAuthRedirect();+ const defaultTemporaryChat = useRecoilValue(temporaryStore.defaultTemporaryChat);const setIsTemporary = useRecoilCallback(({ set }) =>(value: boolean) => {@@ -47,12 +48,14 @@ export default function ChatRoute() {const isTemporaryChat = conversation && conversation.expiredAt ? true : false;useEffect(() => {- if (conversationId !== Constants.NEW_CONVO && !isTemporaryChat) {- setIsTemporary(false);+ if (conversationId === Constants.NEW_CONVO) {+ setIsTemporary(defaultTemporaryChat);} else if (isTemporaryChat) {setIsTemporary(isTemporaryChat);+ } else {+ setIsTemporary(false);}- }, [conversationId, isTemporaryChat, setIsTemporary]);+ }, [conversationId, isTemporaryChat, setIsTemporary, defaultTemporaryChat]);/** This effect is mainly for the first conversation state change on first load of the page.* Adjusting this may have unintended consequences on the conversation state.diff --git a/client/src/store/temporary.ts b/client/src/store/temporary.tsindex cddea06155..60f5626920 100644--- a/client/src/store/temporary.ts+++ b/client/src/store/temporary.ts@@ -1,7 +1,9 @@import { atomWithLocalStorage } from '~/store/utils';const isTemporary = atomWithLocalStorage('isTemporary', false);+const defaultTemporaryChat = atomWithLocalStorage('defaultTemporaryChat', false);export default {isTemporary,+ defaultTemporaryChat,};