From 4dc1e025e1eba7eb2dd9153897774ea7dd44eb8c Mon Sep 17 00:00:00 2001 From: leedom Date: Sat, 1 Apr 2023 10:24:06 +0800 Subject: [PATCH 1/4] feat: add confirm tips when deleting conversation on pc --- app/components/home.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/home.tsx b/app/components/home.tsx index 2f09aa273..706156aff 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -121,7 +121,7 @@ export function ChatList() { key={i} selected={i === selectedIndex} onClick={() => selectSession(i)} - onDelete={() => removeSession(i)} + onDelete={() => confirm(Locale.Home.DeleteChat) && removeSession(i)} /> ))} From 45bf2c3d2590b7c6ae43ebeaaffd13e4c489ca72 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Sat, 1 Apr 2023 15:39:30 +0800 Subject: [PATCH 2/4] fix: remove scroll anchor height --- app/components/home.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/components/home.tsx b/app/components/home.tsx index 706156aff..6f1d77cdb 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -108,7 +108,7 @@ export function ChatList() { state.currentSessionIndex, state.selectSession, state.removeSession, - ], + ] ); return ( @@ -202,7 +202,7 @@ export function Chat(props: { setPromptHints(promptStore.search(text)); }, 100, - { leading: true, trailing: true }, + { leading: true, trailing: true } ); const onPromptSelect = (prompt: Prompt) => { @@ -216,7 +216,7 @@ export function Chat(props: { if (!dom) return; const paddingBottomNum: number = parseInt( window.getComputedStyle(dom).paddingBottom, - 10, + 10 ); dom.scrollTop = dom.scrollHeight - dom.offsetHeight + paddingBottomNum; }; @@ -304,7 +304,7 @@ export function Chat(props: { preview: true, }, ] - : [], + : [] ) .concat( userInput.length > 0 @@ -316,7 +316,7 @@ export function Chat(props: { preview: true, }, ] - : [], + : [] ); // auto scroll @@ -354,7 +354,7 @@ export function Chat(props: { const newTopic = prompt(Locale.Chat.Rename, session.topic); if (newTopic && newTopic !== session.topic) { chatStore.updateCurrentSession( - (session) => (session.topic = newTopic!), + (session) => (session.topic = newTopic!) ); } }} @@ -470,7 +470,7 @@ export function Chat(props: { ); })} -
+
-
@@ -600,7 +600,7 @@ export function Home() { state.newSession, state.currentSessionIndex, state.removeSession, - ], + ] ); const loading = !useHasHydrated(); const [showSideBar, setShowSideBar] = useState(true); From 0385f6ede919117e7278cd64fe01f7d688805059 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Sat, 1 Apr 2023 15:46:34 +0800 Subject: [PATCH 3/4] fix: #305 disable double click to copy on pc --- app/components/home.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/components/home.tsx b/app/components/home.tsx index 6f1d77cdb..de93510db 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -453,7 +453,10 @@ export function Chat(props: { className="markdown-body" style={{ fontSize: `${fontSize}px` }} onContextMenu={(e) => onRightClick(e, message)} - onDoubleClickCapture={() => setUserInput(message.content)} + onDoubleClickCapture={() => { + if (!isMobileScreen()) return; + setUserInput(message.content); + }} > From ad63b10aead9445dc864203505efb7620957d563 Mon Sep 17 00:00:00 2001 From: Yorun <547747006@qq.com> Date: Sat, 1 Apr 2023 11:52:10 +0000 Subject: [PATCH 4/4] ci: update sync action --- .github/workflows/sync.yml | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 9914a603a..1c9dc413c 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -1,16 +1,29 @@ -# .github/workflows/sync.yml -name: Sync Fork +name: Upstream Sync on: - schedule: - - cron: "0 8 * * *" # 每天0点触发 + schedule: + - cron: '0 */12 * * *' # every 12 hours + workflow_dispatch: # on button click + jobs: - repo-sync: - runs-on: ubuntu-latest - steps: - - uses: TG908/fork-sync@v1.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} # 这个 token action 会默认配置, 这里只需这样写就行 - owner: Yidadaa # fork 上游项目 owner - head: main # fork 上游项目需要同步的分支 - base: main # 需要同步到本项目的目标分支 + sync_latest_from_upstream: + name: Sync latest commits from upstream repo + runs-on: ubuntu-latest + + steps: + # Step 1: run a standard checkout action, provided by github + - name: Checkout target repo + uses: actions/checkout@v3 + + # Step 2: run the sync action + - name: Sync upstream changes + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + with: + upstream_sync_repo: Yidadaa/ChatGPT-Next-Web + upstream_sync_branch: main + target_sync_branch: main + target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set + + # Set test_mode true to run tests instead of the true action!! + test_mode: false