Skip to content

Commit 698be66

Browse files
committed
feat: enable drag area for tauri apps
1 parent 47c546f commit 698be66

File tree

10 files changed

+73
-14
lines changed

10 files changed

+73
-14
lines changed

app/components/chat.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ export function Chat() {
728728

729729
return (
730730
<div className={styles.chat} key={session.id}>
731-
<div className="window-header">
731+
<div className="window-header" data-tauri-drag-region>
732732
<div className="window-header-title">
733733
<div
734734
className={`window-header-main-title " ${styles["chat-body-title"]}`}

app/components/settings.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export function Settings() {
291291

292292
return (
293293
<ErrorBoundary>
294-
<div className="window-header">
294+
<div className="window-header" data-tauri-drag-region>
295295
<div className="window-header-title">
296296
<div className="window-header-main-title">
297297
{Locale.Settings.Title}

app/components/sidebar.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,10 @@ export function SideBar(props: { className?: string }) {
118118
shouldNarrow && styles["narrow-sidebar"]
119119
}`}
120120
>
121-
<div className={styles["sidebar-header"]}>
122-
<div className={styles["sidebar-title"]}>ChatGPT Next</div>
121+
<div className={styles["sidebar-header"]} data-tauri-drag-region>
122+
<div className={styles["sidebar-title"]} data-tauri-drag-region>
123+
ChatGPT Next
124+
</div>
123125
<div className={styles["sidebar-sub-title"]}>
124126
Build your own AI assistant.
125127
</div>

app/locales/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ function getLanguage() {
6969
try {
7070
return navigator.language.toLowerCase();
7171
} catch {
72-
console.log("[Lang] failed to detect user lang.");
7372
return DEFAULT_LANG;
7473
}
7574
}

app/styles/markdown.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1116,4 +1116,4 @@
11161116

11171117
.markdown-body ::-webkit-calendar-picker-indicator {
11181118
filter: invert(50%);
1119-
}
1119+
}

next.config.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ const nextConfig = {
1212
return config;
1313
},
1414
output: mode,
15+
images: {
16+
unoptimized: mode === "export",
17+
},
1518
};
1619

1720
if (mode !== "export") {

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"remark-gfm": "^3.0.1",
3737
"remark-math": "^5.1.1",
3838
"sass": "^1.59.2",
39-
"sharp": "^0.32.1",
4039
"spark-md5": "^3.0.2",
4140
"use-debounce": "^9.0.3",
4241
"zustand": "^4.3.6"

src-tauri/Cargo.lock

+34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22
name = "chatgpt-next-web"
33
version = "0.1.0"
4-
description = "A Tauri App"
4+
description = "A cross platform app for LLM ChatBot."
55
authors = ["Yidadaa"]
6-
license = "anti-996"
6+
license = "mit"
77
repository = ""
88
default-run = "chatgpt-next-web"
99
edition = "2021"
@@ -17,7 +17,7 @@ tauri-build = { version = "1.3.0", features = [] }
1717
[dependencies]
1818
serde_json = "1.0"
1919
serde = { version = "1.0", features = ["derive"] }
20-
tauri = { version = "1.3.0", features = [] }
20+
tauri = { version = "1.3.0", features = ["clipboard-all", "shell-open", "window-close", "window-hide", "window-maximize", "window-minimize", "window-set-icon", "window-set-ignore-cursor-events", "window-set-resizable", "window-show", "window-start-dragging", "window-unmaximize", "window-unminimize"] }
2121

2222
[features]
2323
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.

src-tauri/tauri.conf.json

+26-4
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,37 @@
88
},
99
"package": {
1010
"productName": "chatgpt-next-web",
11-
"version": "2.8.1"
11+
"version": "2.8.2"
1212
},
1313
"tauri": {
1414
"allowlist": {
15-
"all": false
15+
"all": false,
16+
"shell": {
17+
"all": false,
18+
"open": true
19+
},
20+
"clipboard": {
21+
"all": true
22+
},
23+
"window": {
24+
"all": false,
25+
"close": true,
26+
"hide": true,
27+
"maximize": true,
28+
"minimize": true,
29+
"setIcon": true,
30+
"setIgnoreCursorEvents": true,
31+
"setResizable": true,
32+
"show": true,
33+
"startDragging": true,
34+
"unmaximize": true,
35+
"unminimize": true
36+
}
1637
},
1738
"bundle": {
1839
"active": true,
1940
"category": "DeveloperTool",
20-
"copyright": "",
41+
"copyright": "2023, Zhang Yifei All Rights Reserved.",
2142
"deb": {
2243
"depends": []
2344
},
@@ -59,7 +80,8 @@
5980
"height": 600,
6081
"resizable": true,
6182
"title": "ChatGPT Next Web",
62-
"width": 960
83+
"width": 960,
84+
"titleBarStyle": "Overlay"
6385
}
6486
]
6587
}

0 commit comments

Comments
 (0)