From cbb50c14e1fd8513d3b89cf958a12e5499a1cd01 Mon Sep 17 00:00:00 2001 From: "ShengYan, Zhang" Date: Thu, 11 May 2023 15:42:32 +0800 Subject: [PATCH 1/4] fix: bug #1413 input '/' when clicking icon to open prompt modal --- app/components/chat.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 54def01..d476731 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -790,6 +790,7 @@ export function Chat() { hitBottom={hitBottom} showPromptHints={() => { inputRef.current?.focus(); + setUserInput("/"); onSearch(""); }} /> From 7bf74c6a5d07e5746a1299b61a3cac1bd08ec416 Mon Sep 17 00:00:00 2001 From: "ShengYan, Zhang" Date: Thu, 11 May 2023 16:08:34 +0800 Subject: [PATCH 2/4] fix: bug #1413 cmd/alt/ctrl should be checked for arrowUp events --- app/components/chat.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index d476731..10f7c00 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -230,7 +230,9 @@ export function PromptHints(props: { useEffect(() => { const onKeyDown = (e: KeyboardEvent) => { if (noPrompts) return; - + if (e.metaKey || e.altKey || e.ctrlKey) { + return; + } // arrow up / down to select prompt const changeIndex = (delta: number) => { e.stopPropagation(); @@ -491,7 +493,11 @@ export function Chat() { // check if should send message const onInputKeyDown = (e: React.KeyboardEvent) => { // if ArrowUp and no userInput, fill with last input - if (e.key === "ArrowUp" && userInput.length <= 0) { + if ( + e.key === "ArrowUp" && + userInput.length <= 0 && + !(e.metaKey || e.altKey || e.ctrlKey) + ) { setUserInput(localStorage.getItem(LAST_INPUT_KEY) ?? ""); e.preventDefault(); return; From ec19b86ade04857bf339b26c853f27b0ba2688a8 Mon Sep 17 00:00:00 2001 From: liyuze Date: Thu, 11 May 2023 18:29:25 +0800 Subject: [PATCH 3/4] fix: click the prompt button to hide hints when it's already shown --- app/components/chat.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 54def01..9363966 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -789,6 +789,12 @@ export function Chat() { scrollToBottom={scrollToBottom} hitBottom={hitBottom} showPromptHints={() => { + // Click again to close + if (promptHints.length > 0) { + setPromptHints([]); + return; + } + inputRef.current?.focus(); onSearch(""); }} From 36adfe87fb965120a208df907a609ec235437d06 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Thu, 11 May 2023 23:21:16 +0800 Subject: [PATCH 4/4] fix: #1401 try to disable zoom --- app/layout.tsx | 7 ++++--- app/requests.ts | 2 +- app/store/access.ts | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/layout.tsx b/app/layout.tsx index c56341a..f2e765a 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -13,7 +13,7 @@ export const metadata = { title: "ChatGPT Next Web", statusBarStyle: "default", }, - themeColor: "#fafafa", + viewport: "width=device-width, initial-scale=1, maximum-scale=1", }; export default function RootLayout({ @@ -25,8 +25,9 @@ export default function RootLayout({ = {}; diff --git a/app/store/access.ts b/app/store/access.ts index 79b7b99..4e870b6 100644 --- a/app/store/access.ts +++ b/app/store/access.ts @@ -1,6 +1,7 @@ import { create } from "zustand"; import { persist } from "zustand/middleware"; import { StoreKey } from "../constant"; +import { getHeaders } from "../requests"; import { BOT_HELLO } from "./chat"; import { ALL_MODELS } from "./config"; @@ -55,6 +56,9 @@ export const useAccessStore = create()( fetch("/api/config", { method: "post", body: null, + headers: { + ...getHeaders(), + }, }) .then((res) => res.json()) .then((res: DangerConfig) => {