diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..eb83f7741 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,43 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +** Deployment +- [ ] Docker +- [ ] Vercel +- [ ] Server + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional Logs** +Add any logs about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..bbcbbe7d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/功能建议.md b/.github/ISSUE_TEMPLATE/功能建议.md new file mode 100644 index 000000000..9ed1c845d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/功能建议.md @@ -0,0 +1,20 @@ +--- +name: 功能建议 +about: 请告诉我们你的灵光一闪 +title: "[Feature] " +labels: '' +assignees: '' + +--- + +**这个功能与现有的问题有关吗?** +如果有关,请在此列出链接或者描述问题。 + +**你想要什么功能或者有什么建议?** +尽管告诉我们。 + +**有没有可以参考的同类竞品?** +可以给出参考产品的链接或者截图。 + +**其他信息** +可以说说你的其他考虑。 diff --git a/.github/ISSUE_TEMPLATE/反馈问题.md b/.github/ISSUE_TEMPLATE/反馈问题.md new file mode 100644 index 000000000..4545721e6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/反馈问题.md @@ -0,0 +1,23 @@ +--- +name: 反馈问题 +about: 请告诉我们你遇到的问题 +title: "[Bug] " +labels: '' +assignees: '' + +--- + +**描述问题** +请在此描述你遇到了什么问题。 + +**如何复现** +请告诉我们你是通过什么操作触发的该问题。 + +**截图** +请在此提供控制台截图、屏幕截图或者服务端的 log 截图。 + +**一些必要的信息** + - 系统:[比如 windows 10/ macos 12/ linux / android 11 / ios 16] + - 浏览器: [比如 chrome, safari] + - 版本: [填写设置页面的版本号] + - 部署方式:[比如 vercel、docker 或者服务器部署] diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 599921d2e..52307078d 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -17,6 +17,7 @@ import { Message, SubmitKey, useChatStore, BOT_HELLO, ROLES } from "../store"; import { copyToClipboard, downloadAs, + getEmojiUrl, isMobileScreen, selectOrCopy, } from "../utils"; @@ -50,7 +51,7 @@ export function Avatar(props: { role: Message["role"] }) { return (
- +
); } diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 1b51356eb..b563d7bab 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -26,7 +26,7 @@ import { import { Avatar } from "./chat"; import Locale, { AllLangs, changeLang, getLang } from "../locales"; -import { getCurrentVersion } from "../utils"; +import { getCurrentVersion, getEmojiUrl } from "../utils"; import Link from "next/link"; import { UPDATE_URL } from "../constant"; import { SearchService, usePromptStore } from "../store/prompt"; @@ -181,6 +181,7 @@ export function Settings(props: { closeSettings: () => void }) { { updateConfig((config) => (config.avatar = e.unified)); setShowEmojiPicker(false); diff --git a/app/utils.ts b/app/utils.ts index 5fe277c63..89084a7a0 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -1,3 +1,4 @@ +import { EmojiStyle } from "emoji-picker-react"; import { showToast } from "./components/ui-lib"; import Locale from "./locales"; @@ -6,17 +7,23 @@ export function trimTopic(topic: string) { } export async function copyToClipboard(text: string) { - try { - await navigator.clipboard.writeText(text); - } catch (error) { - const textarea = document.createElement("textarea"); - textarea.value = text; - document.body.appendChild(textarea); - textarea.select(); - document.execCommand("copy"); - document.body.removeChild(textarea); - } finally { - showToast(Locale.Copy.Success); + if (navigator.clipboard) { + navigator.clipboard.writeText(text).catch(err => { + console.error('Failed to copy: ', err); + }); + } else { + const textArea = document.createElement('textarea'); + textArea.value = text; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + try { + document.execCommand('copy'); + console.log('Text copied to clipboard'); + } catch (err) { + console.error('Failed to copy: ', err); + } + document.body.removeChild(textArea); } } @@ -81,3 +88,7 @@ export function getCurrentVersion() { return currentId; } + +export function getEmojiUrl(unified: string, style: EmojiStyle) { + return `https://cdn.staticfile.org/emoji-datasource-apple/14.0.0/img/${style}/64/${unified}.png`; +}