diff --git a/README-ZH_CN.md b/README-ZH_CN.md index 395fb03..e7c1d0b 100644 --- a/README-ZH_CN.md +++ b/README-ZH_CN.md @@ -24,7 +24,7 @@ ### Windows -- [ChatGPT_0.10.2_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.10.2/ChatGPT_0.10.2_x64_en-US.msi): +- [ChatGPT_0.10.3_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.10.3/ChatGPT_0.10.3_x64_en-US.msi): - 使用 [winget](https://winstall.app/apps/lencx.ChatGPT): ```bash @@ -35,12 +35,12 @@ winget install --id=lencx.ChatGPT -e --version 0.10.0 ``` -**注意:如果安装路径和应用名称相同,会导致冲突 ([#142](https://github.com/lencx/ChatGPT/issues/142#issuecomment-0.10.2))** +**注意:如果安装路径和应用名称相同,会导致冲突 ([#142](https://github.com/lencx/ChatGPT/issues/142#issuecomment-0.10.3))** ### Mac -- [ChatGPT_0.10.2_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.10.2/ChatGPT_0.10.2_x64.dmg) -- [ChatGPT.app.tar.gz](https://github.com/lencx/ChatGPT/releases/download/v0.10.2/ChatGPT.app.tar.gz) +- [ChatGPT_0.10.3_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.10.3/ChatGPT_0.10.3_x64.dmg) +- [ChatGPT.app.tar.gz](https://github.com/lencx/ChatGPT/releases/download/v0.10.3/ChatGPT.app.tar.gz) - Homebrew \ _[Homebrew 快捷安装](https://brew.sh) ([Cask](https://docs.brew.sh/Cask-Cookbook)):_ ```sh @@ -56,8 +56,8 @@ ### Linux -- [chat-gpt_0.10.2_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.10.2/chat-gpt_0.10.2_amd64.deb) -- [chat-gpt_0.10.2_amd64.AppImage](https://github.com/lencx/ChatGPT/releases/download/v0.10.2/chat-gpt_0.10.2_amd64.AppImage): **工作可靠,`.deb` 运行失败时可以尝试它** +- [chat-gpt_0.10.3_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.10.3/chat-gpt_0.10.3_amd64.deb) +- [chat-gpt_0.10.3_amd64.AppImage](https://github.com/lencx/ChatGPT/releases/download/v0.10.3/chat-gpt_0.10.3_amd64.AppImage): **工作可靠,`.deb` 运行失败时可以尝试它** - 使用 [AUR](https://aur.archlinux.org/packages/chatgpt-desktop-bin): ```bash yay -S chatgpt-desktop-bin diff --git a/README.md b/README.md index 4365bce..f07a2d7 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ ### Windows -- [ChatGPT_0.10.2_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.10.2/ChatGPT_0.10.2_x64_en-US.msi): Direct download installer +- [ChatGPT_0.10.3_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.10.3/ChatGPT_0.10.3_x64_en-US.msi): Direct download installer - Use [winget](https://winstall.app/apps/lencx.ChatGPT): ```bash @@ -38,12 +38,12 @@ winget install --id=lencx.ChatGPT -e --version 0.10.0 ``` -**Note: If the installation path and application name are the same, it will lead to conflict ([#142](https://github.com/lencx/ChatGPT/issues/142#issuecomment-0.10.2))** +**Note: If the installation path and application name are the same, it will lead to conflict ([#142](https://github.com/lencx/ChatGPT/issues/142#issuecomment-0.10.3))** ### Mac -- [ChatGPT_0.10.2_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.10.2/ChatGPT_0.10.2_x64.dmg): Direct download installer -- [ChatGPT.app.tar.gz](https://github.com/lencx/ChatGPT/releases/download/v0.10.2/ChatGPT.app.tar.gz): Download the `.app` installer +- [ChatGPT_0.10.3_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.10.3/ChatGPT_0.10.3_x64.dmg): Direct download installer +- [ChatGPT.app.tar.gz](https://github.com/lencx/ChatGPT/releases/download/v0.10.3/ChatGPT.app.tar.gz): Download the `.app` installer - Homebrew \ Or you can install with _[Homebrew](https://brew.sh) ([Cask](https://docs.brew.sh/Cask-Cookbook)):_ ```sh @@ -59,8 +59,8 @@ ### Linux -- [chat-gpt_0.10.2_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.10.2/chat-gpt_0.10.2_amd64.deb): Download `.deb` installer, advantage small size, disadvantage poor compatibility -- [chat-gpt_0.10.2_amd64.AppImage](https://github.com/lencx/ChatGPT/releases/download/v0.10.2/chat-gpt_0.10.2_amd64.AppImage): Works reliably, you can try it if `.deb` fails to run +- [chat-gpt_0.10.3_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.10.3/chat-gpt_0.10.3_amd64.deb): Download `.deb` installer, advantage small size, disadvantage poor compatibility +- [chat-gpt_0.10.3_amd64.AppImage](https://github.com/lencx/ChatGPT/releases/download/v0.10.3/chat-gpt_0.10.3_amd64.AppImage): Works reliably, you can try it if `.deb` fails to run - Available on [AUR](https://aur.archlinux.org/packages/chatgpt-desktop-bin) with the package name `chatgpt-desktop-bin`, and you can use your favourite AUR package manager to install it. diff --git a/UPDATE_LOG.md b/UPDATE_LOG.md index ccc4cc9..4f0a39f 100644 --- a/UPDATE_LOG.md +++ b/UPDATE_LOG.md @@ -1,5 +1,18 @@ # UPDATE LOG +## v0.10.3 + +> Note: As of now the ChatGPT desktop app has added a lot of exciting features and it continues to improve, as the app grows it has gone far beyond what ChatGPT was intended for. I want to make it the ultimate goal that any website can be easily wrapped to the desktop through user customization. So it needed an international user guide to guide users to use it more professionally. And https://app.nofwl.com is the manual for the app, which will be built into the app (`Menu -> Window -> ChatGPT User's Guide`) so you can access it anytime. It's just starting at the moment, so stay tuned. + +Fix: + +- Incompatible configuration data causes program crashes (https://github.com/lencx/ChatGPT/issues/295) + +Feat: + +- Silent copy text +- Markdown export support distinguishes between users and bots (https://github.com/lencx/ChatGPT/issues/233) + ## v0.10.2 Fix: diff --git a/src-tauri/src/conf.rs b/src-tauri/src/conf.rs index 99349d2..56e0439 100644 --- a/src-tauri/src/conf.rs +++ b/src-tauri/src/conf.rs @@ -76,7 +76,14 @@ impl AppConf { pub fn read() -> Self { match std::fs::read_to_string(Self::file_path()) { - Ok(v) => serde_json::from_str::(&v).unwrap(), + Ok(v) => { + if let Ok(v2) = serde_json::from_str::(&v) { + v2 + } else { + error!("conf_read_parse_error"); + Self::default() + } + } Err(err) => { error!("conf_read_error: {}", err); Self::default() diff --git a/src-tauri/src/scripts/cmd.js b/src-tauri/src/scripts/cmd.js index 9a7f727..385b4fb 100644 --- a/src-tauri/src/scripts/cmd.js +++ b/src-tauri/src/scripts/cmd.js @@ -79,6 +79,10 @@ function init() { width: 16px; height: 16px; } + .chatappico.cpok { + width: 16px; + height: 16px; + } @media screen and (max-width: 767px) { #download-png-button, #download-pdf-button, #download-html-button { display: none; diff --git a/src-tauri/src/scripts/export.js b/src-tauri/src/scripts/export.js index 08bf45b..6924bf6 100644 --- a/src-tauri/src/scripts/export.js +++ b/src-tauri/src/scripts/export.js @@ -137,7 +137,14 @@ function addActionsButtons(actionsArea, TryAgainButton) { } async function exportMarkdown() { - const data = ExportMD.turndown(document.querySelector("main div>div>div").innerHTML); + const content = Array.from(document.querySelectorAll("main >div>div>div>div")).map(i => { + let j = i.cloneNode(true); + if (/dark\:bg-gray-800/.test(i.getAttribute('class'))) { + j.innerHTML = `
${i.innerHTML}
`; + } + return j.innerHTML; + }).join('
'); + const data = ExportMD.turndown(content); const { id, filename } = getName(); await invoke('save_file', { name: `notes/${id}.md`, content: data }); await invoke('download_list', { pathname: 'chat.notes.json', filename, id, dir: 'notes' }); @@ -274,7 +281,8 @@ function setIcon(type) { png: ``, pdf: ``, md: ``, - copy: `` + copy: ``, + cpok: `` }[type]; } @@ -289,12 +297,14 @@ function copyBtns() { btn.innerHTML = setIcon('copy'); i.querySelector('.self-end').appendChild(btn); btn.onclick = () => { - copyToClipboard(i?.innerText?.trim() || ''); + copyToClipboard(i?.innerText?.trim() || '', btn); } }) } -function copyToClipboard(text) { +function copyToClipboard(text, btn) { + window.clearTimeout(window.__cpTimeout); + btn.innerHTML = setIcon('cpok'); if (navigator.clipboard) { navigator.clipboard.writeText(text); } else { @@ -308,7 +318,9 @@ function copyToClipboard(text) { document.execCommand('copy', true); document.body.removeChild(textarea); } - message('Copied to clipboard'); + window.__cpTimeout = setTimeout(() => { + btn.innerHTML = setIcon('copy'); + }, 1000); } if ( diff --git a/src-tauri/src/scripts/markdown.export.js b/src-tauri/src/scripts/markdown.export.js index 651eebc..4c9d5fb 100644 --- a/src-tauri/src/scripts/markdown.export.js +++ b/src-tauri/src/scripts/markdown.export.js @@ -2,7 +2,9 @@ var ExportMD = (function () { if (!TurndownService || !turndownPluginGfm) return; const hljsREG = /^.*(hljs).*(language-[a-z0-9]+).*$/i; const gfm = turndownPluginGfm.gfm - const turndownService = new TurndownService() + const turndownService = new TurndownService({ + hr: '---' + }) .use(gfm) .addRule('code', { filter: (node) => { diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index e2b3bdb..5b46b0d 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "ChatGPT", - "version": "0.10.2" + "version": "0.10.3" }, "tauri": { "allowlist": {