diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml
new file mode 100644
index 000000000..01c44e217
--- /dev/null
+++ b/.github/workflows/app.yml
@@ -0,0 +1,91 @@
+name: Release App
+
+on:
+ workflow_dispatch:
+ release:
+ types: [published]
+
+jobs:
+ create-release:
+ permissions:
+ contents: write
+ runs-on: ubuntu-20.04
+ outputs:
+ release_id: ${{ steps.create-release.outputs.result }}
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: setup node
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16
+ - name: get version
+ run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
+ - name: create release
+ id: create-release
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const { data } = await github.rest.repos.createRelease({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ tag_name: `app-v${process.env.PACKAGE_VERSION}`,
+ name: `Desktop App v${process.env.PACKAGE_VERSION}`,
+ body: 'Take a look at the assets to download and install this app.',
+ draft: true,
+ prerelease: false
+ })
+ return data.id
+
+ build-tauri:
+ needs: create-release
+ permissions:
+ contents: write
+ strategy:
+ fail-fast: false
+ matrix:
+ platform: [macos-latest, ubuntu-20.04, windows-latest]
+
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - uses: actions/checkout@v3
+ - name: setup node
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16
+ - name: install Rust stable
+ uses: dtolnay/rust-toolchain@stable
+ - name: install dependencies (ubuntu only)
+ if: matrix.platform == 'ubuntu-20.04'
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
+ - name: install frontend dependencies
+ run: yarn install # change this to npm or pnpm depending on which one you use
+ - uses: tauri-apps/tauri-action@v0
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ releaseId: ${{ needs.create-release.outputs.release_id }}
+
+ publish-release:
+ permissions:
+ contents: write
+ runs-on: ubuntu-20.04
+ needs: [create-release, build-tauri]
+
+ steps:
+ - name: publish release
+ id: publish-release
+ uses: actions/github-script@v6
+ env:
+ release_id: ${{ needs.create-release.outputs.release_id }}
+ with:
+ script: |
+ github.rest.repos.updateRelease({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ release_id: process.env.release_id,
+ draft: false,
+ prerelease: false
+ })
diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml
index a4c14c843..ebf5587d0 100644
--- a/.github/workflows/sync.yml
+++ b/.github/workflows/sync.yml
@@ -35,6 +35,6 @@ jobs:
- name: Sync check
if: failure()
run: |
- echo "::error::由于权限不足,导致同步失败(这是预期的行为),请前往仓库首页手动执行[Sync fork]。"
- echo "::error::Due to insufficient permissions, synchronization failed (as expected). Please go to the repository homepage and manually perform [Sync fork]."
+ echo "[Error] 由于上游仓库的 workflow 文件变更,导致 GitHub 自动暂停了本次自动更新,你需要手动 Sync Fork 一次,详细教程请查看:https://github.com/Yidadaa/ChatGPT-Next-Web/blob/main/README_CN.md#%E6%89%93%E5%BC%80%E8%87%AA%E5%8A%A8%E6%9B%B4%E6%96%B0"
+ echo "[Error] Due to a change in the workflow file of the upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork. Please refer to the detailed tutorial for instructions: https://github.com/Yidadaa/ChatGPT-Next-Web#enable-automatic-updates"
exit 1
diff --git a/app/components/chat.tsx b/app/components/chat.tsx
index ffd2b7d29..38daa3cde 100644
--- a/app/components/chat.tsx
+++ b/app/components/chat.tsx
@@ -1,5 +1,11 @@
import { useDebouncedCallback } from "use-debounce";
-import React, { useState, useRef, useEffect, useLayoutEffect } from "react";
+import React, {
+ useState,
+ useRef,
+ useEffect,
+ useLayoutEffect,
+ useMemo,
+} from "react";
import SendWhiteIcon from "../icons/send-white.svg";
import BrainIcon from "../icons/brain.svg";
@@ -61,6 +67,7 @@ import { useMaskStore } from "../store/mask";
import { useCommand } from "../command";
import { prettyObject } from "../utils/format";
import { ExportMessageModal } from "./exporter";
+import { getClientConfig } from "../config/client";
const Markdown = dynamic(async () => (await import("./markdown")).Markdown, {
loading: () => ,
@@ -704,9 +711,13 @@ export function Chat() {
}
};
+ const clientConfig = useMemo(() => getClientConfig(), []);
+
const location = useLocation();
const isChat = location.pathname === Path.Chat;
+
const autoFocus = !isMobileScreen || isChat; // only focus in chat page
+ const showMaxIcon = !isMobileScreen && !clientConfig?.isApp;
useCommand({
fill: setUserInput,
@@ -755,7 +766,7 @@ export function Chat() {
}}
/>
- {!isMobileScreen && (
+ {showMaxIcon && (
:
}
diff --git a/app/components/settings.tsx b/app/components/settings.tsx
index 4f8379f59..38e6107fb 100644
--- a/app/components/settings.tsx
+++ b/app/components/settings.tsx
@@ -286,6 +286,9 @@ export function Settings() {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
+ const clientConfig = useMemo(() => getClientConfig(), []);
+ const showAccessCode = enabledAccessControl && !clientConfig?.isApp;
+
return (
@@ -485,7 +488,7 @@ export function Settings() {
- {enabledAccessControl ? (
+ {showAccessCode ? (
{
return {
commitId: COMMIT_ID,
buildMode: process.env.BUILD_MODE ?? "standalone",
+ isApp: !!process.env.BUILD_APP,
};
};
diff --git a/app/config/server.ts b/app/config/server.ts
index f5fee7190..0f6e6fb86 100644
--- a/app/config/server.ts
+++ b/app/config/server.ts
@@ -11,6 +11,7 @@ declare global {
HIDE_USER_API_KEY?: string; // disable user's api key input
DISABLE_GPT4?: string; // allow user to use gpt-4 or not
BUILD_MODE?: "standalone" | "export";
+ BUILD_APP?: string; // is building desktop app
}
}
}
diff --git a/app/store/access.ts b/app/store/access.ts
index daefa0aad..0601903d3 100644
--- a/app/store/access.ts
+++ b/app/store/access.ts
@@ -60,7 +60,7 @@ export const useAccessStore = create()(
);
},
fetch() {
- if (fetchState > 0) return;
+ if (fetchState > 0 || getClientConfig()?.buildMode === "export") return;
fetchState = 1;
fetch("/api/config", {
method: "post",
diff --git a/app/store/config.ts b/app/store/config.ts
index 3378b9c36..6858fc5ec 100644
--- a/app/store/config.ts
+++ b/app/store/config.ts
@@ -1,6 +1,7 @@
import { create } from "zustand";
import { persist } from "zustand/middleware";
import { StoreKey } from "../constant";
+import { getBuildConfig } from "../config/build";
export enum SubmitKey {
Enter = "Enter",
@@ -21,7 +22,7 @@ export const DEFAULT_CONFIG = {
avatar: "1f603",
fontSize: 14,
theme: Theme.Auto as Theme,
- tightBorder: false,
+ tightBorder: !getBuildConfig().isApp,
sendPreviewBubble: true,
sidebarWidth: 300,
diff --git a/package.json b/package.json
index b7e920e3e..35a98e085 100644
--- a/package.json
+++ b/package.json
@@ -7,9 +7,10 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
- "export": "BUILD_MODE=export yarn build",
- "export:dev": "BUILD_MODE=export yarn dev",
+ "export": "cross-env BUILD_MODE=export BUILD_APP=1 yarn build",
+ "export:dev": "cross-env BUILD_MODE=export BUILD_APP=1 yarn dev",
"app:dev": "yarn tauri dev",
+ "app:build": "yarn tauri build",
"prompts": "node ./scripts/fetch-prompts.mjs",
"prepare": "husky install",
"proxy-dev": "sh ./scripts/init-proxy.sh && proxychains -f ./scripts/proxychains.conf yarn dev"
diff --git a/src-tauri/icons/128x128.png b/src-tauri/icons/128x128.png
index 77e7d2338..7fee8db6e 100644
Binary files a/src-tauri/icons/128x128.png and b/src-tauri/icons/128x128.png differ
diff --git a/src-tauri/icons/128x128@2x.png b/src-tauri/icons/128x128@2x.png
index 0f7976f1a..178761b6a 100644
Binary files a/src-tauri/icons/128x128@2x.png and b/src-tauri/icons/128x128@2x.png differ
diff --git a/src-tauri/icons/32x32.png b/src-tauri/icons/32x32.png
index 98fda06fc..471cdbb65 100644
Binary files a/src-tauri/icons/32x32.png and b/src-tauri/icons/32x32.png differ
diff --git a/src-tauri/icons/Square107x107Logo.png b/src-tauri/icons/Square107x107Logo.png
index f35d84ff1..241e101ba 100644
Binary files a/src-tauri/icons/Square107x107Logo.png and b/src-tauri/icons/Square107x107Logo.png differ
diff --git a/src-tauri/icons/Square142x142Logo.png b/src-tauri/icons/Square142x142Logo.png
index 1823bb269..b27ce753d 100644
Binary files a/src-tauri/icons/Square142x142Logo.png and b/src-tauri/icons/Square142x142Logo.png differ
diff --git a/src-tauri/icons/Square150x150Logo.png b/src-tauri/icons/Square150x150Logo.png
index dc2b22cea..d9d58df2d 100644
Binary files a/src-tauri/icons/Square150x150Logo.png and b/src-tauri/icons/Square150x150Logo.png differ
diff --git a/src-tauri/icons/Square284x284Logo.png b/src-tauri/icons/Square284x284Logo.png
index 0ed3984c5..64dd15d81 100644
Binary files a/src-tauri/icons/Square284x284Logo.png and b/src-tauri/icons/Square284x284Logo.png differ
diff --git a/src-tauri/icons/Square30x30Logo.png b/src-tauri/icons/Square30x30Logo.png
index 60bf0eadf..c585069db 100644
Binary files a/src-tauri/icons/Square30x30Logo.png and b/src-tauri/icons/Square30x30Logo.png differ
diff --git a/src-tauri/icons/Square310x310Logo.png b/src-tauri/icons/Square310x310Logo.png
index c8ca0ad13..70b0b5ddb 100644
Binary files a/src-tauri/icons/Square310x310Logo.png and b/src-tauri/icons/Square310x310Logo.png differ
diff --git a/src-tauri/icons/Square44x44Logo.png b/src-tauri/icons/Square44x44Logo.png
index 8756459b6..6657a9617 100644
Binary files a/src-tauri/icons/Square44x44Logo.png and b/src-tauri/icons/Square44x44Logo.png differ
diff --git a/src-tauri/icons/Square71x71Logo.png b/src-tauri/icons/Square71x71Logo.png
index 2c8023cc8..865a99ed8 100644
Binary files a/src-tauri/icons/Square71x71Logo.png and b/src-tauri/icons/Square71x71Logo.png differ
diff --git a/src-tauri/icons/Square89x89Logo.png b/src-tauri/icons/Square89x89Logo.png
index 2c5e6034f..4be716430 100644
Binary files a/src-tauri/icons/Square89x89Logo.png and b/src-tauri/icons/Square89x89Logo.png differ
diff --git a/src-tauri/icons/StoreLogo.png b/src-tauri/icons/StoreLogo.png
index 17d142c0a..9791b7adb 100644
Binary files a/src-tauri/icons/StoreLogo.png and b/src-tauri/icons/StoreLogo.png differ
diff --git a/src-tauri/icons/icon.icns b/src-tauri/icons/icon.icns
index a2993adc8..deca5bc69 100644
Binary files a/src-tauri/icons/icon.icns and b/src-tauri/icons/icon.icns differ
diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico
index 06c23c82f..59f1568ee 100644
Binary files a/src-tauri/icons/icon.ico and b/src-tauri/icons/icon.ico differ
diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png
index d1756ce45..3ae7ae9bf 100644
Binary files a/src-tauri/icons/icon.png and b/src-tauri/icons/icon.png differ
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index 9db5da43b..b5f33cd64 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -29,8 +29,8 @@
"icons/icon.icns",
"icons/icon.ico"
],
- "identifier": "com.yida.chatgpt.nextweb",
- "longDescription": "",
+ "identifier": "com.yida.chatgpt.next.web",
+ "longDescription": "ChatGPT Next Web is a cross-platform ChatGPT client, including Web/Win/Linux/OSX/PWA.",
"macOS": {
"entitlements": null,
"exceptionDomain": "",
@@ -39,7 +39,7 @@
"signingIdentity": null
},
"resources": [],
- "shortDescription": "",
+ "shortDescription": "ChatGPT Next Web App",
"targets": "all",
"windows": {
"certificateThumbprint": null,
@@ -59,7 +59,7 @@
"height": 600,
"resizable": true,
"title": "tauri-next",
- "width": 800
+ "width": 960
}
]
}