Skip to content

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

🗨️ refactor: Open New Tab for Ctrl+Click or Button Combo in NewChat (#1484)

Danny Avila42f23535099c
diff --git a/client/src/components/Nav/NewChat.tsx b/client/src/components/Nav/NewChat.tsx
index 873aab2e1c..b0ebb195dc 100644
--- a/client/src/components/Nav/NewChat.tsx
+++ b/client/src/components/Nav/NewChat.tsx
@@ -6,15 +6,19 @@ export default function NewChat({ toggleNav }: { toggleNav: () => void }) {
const navigate = useOriginNavigate();
const localize = useLocalize();
- const clickHandler = () => {
- newConvo();
- newConversation();
- navigate('new');
- toggleNav();
+ const clickHandler = (event: React.MouseEvent<HTMLAnchorElement>) => {
+ if (event.button === 0 && !event.ctrlKey) {
+ event.preventDefault();
+ newConvo();
+ newConversation();
+ navigate('new');
+ toggleNav();
+ }
};
return (
<a
+ href="/"
data-testid="nav-new-chat-button"
onClick={clickHandler}
className="flex h-11 flex-shrink-0 flex-grow cursor-pointer items-center gap-3 rounded-md border border-white/20 px-3 py-3 text-sm text-white transition-colors duration-200 hover:bg-gray-500/10"