diff --git a/src/renderer/src/components/common/ErrorElement.tsx b/src/renderer/src/components/common/ErrorElement.tsx index 335c41a069..27ab5e41df 100644 --- a/src/renderer/src/components/common/ErrorElement.tsx +++ b/src/renderer/src/components/common/ErrorElement.tsx @@ -1,5 +1,6 @@ -import pkg, { repository } from "@pkg" +import pkg from "@pkg" import { attachOpenInEditor } from "@renderer/lib/dev" +import { getNewIssueUrl } from "@renderer/lib/issues" import { clearLocalPersistStoreData } from "@renderer/store/utils/clear" import { useEffect, useRef } from "react" import { isRouteErrorResponse, useRouteError } from "react-router-dom" @@ -63,8 +64,8 @@ export function ErrorElement() {

{APP_NAME} {" "} - has a temporary problem, click the button below to try reloading - the app or another solution? + has a temporary problem, click the button below to try + reloading the app or another solution?

@@ -86,11 +87,11 @@ export function ErrorElement() { Still having this issue? Please give feedback in Github, thanks! diff --git a/src/renderer/src/components/errors/ModalError.tsx b/src/renderer/src/components/errors/ModalError.tsx index f67f6aa41c..5d9e5228a1 100644 --- a/src/renderer/src/components/errors/ModalError.tsx +++ b/src/renderer/src/components/errors/ModalError.tsx @@ -1,5 +1,5 @@ -import { repository } from "@pkg" import { attachOpenInEditor } from "@renderer/lib/dev" +import { getNewIssueUrl } from "@renderer/lib/issues" import type { FallbackRender } from "@sentry/react" import type { FC } from "react" @@ -53,11 +53,11 @@ export const ModalErrorFallback: FC[0]> = ( Still having this issue? Please give feedback in Github, thanks! diff --git a/src/renderer/src/lib/issues.ts b/src/renderer/src/lib/issues.ts new file mode 100644 index 0000000000..b26d6a70f0 --- /dev/null +++ b/src/renderer/src/lib/issues.ts @@ -0,0 +1,21 @@ +import { repository } from "@pkg" + +interface IssueOptions { + title: string + body: string + label: string +} +export const getNewIssueUrl = ({ + body, + label, + title, +}: Partial = {}) => { + const baseUrl = `${repository.url}/issues/new` + + const searchParams = new URLSearchParams() + if (body) searchParams.set("body", (body)) + if (label) searchParams.set("label", label) + if (title) searchParams.set("title", (title)) + + return `${baseUrl}?${searchParams.toString()}` +} diff --git a/src/renderer/src/modules/feed-column/item.tsx b/src/renderer/src/modules/feed-column/item.tsx index d4bf126962..9d9b1a200f 100644 --- a/src/renderer/src/modules/feed-column/item.tsx +++ b/src/renderer/src/modules/feed-column/item.tsx @@ -11,6 +11,7 @@ import { useFeedActions } from "@renderer/hooks/biz/useFeedActions" import { useNavigateEntry } from "@renderer/hooks/biz/useNavigateEntry" import { useRouteParamsSelector } from "@renderer/hooks/biz/useRouteParams" import { nextFrame } from "@renderer/lib/dom" +import { getNewIssueUrl } from "@renderer/lib/issues" import { showNativeMenu } from "@renderer/lib/native-menu" import { cn } from "@renderer/lib/utils" import { useFeedById } from "@renderer/store/feed" @@ -74,7 +75,36 @@ const FeedItemImpl = ({ window.open(`${WEB_URL}/feed/${feedId}?view=${view}`, "_blank") }} onContextMenu={(e) => { - showNativeMenu(items, e) + const nextItems = items.concat() + if (feed.errorAt && feed.errorMessage) { + nextItems.push( + { + type: "separator", + disabled: false, + }, + { + label: "Feedback", + type: "text", + click: () => { + window.open( + getNewIssueUrl({ + body: + `### Error\n\nError Message: ${feed.errorMessage}\n\n### Info\n\n` + + `\`\`\`json\n${ + JSON.stringify(feed, null, 2) + }\n\`\`\``, + label: "bug", + title: `Feed Error: ${feed.title}, ${feed.errorMessage}`, + }), + ) + }, + }, + ) + } + showNativeMenu( + nextItems, + e, + ) }} >
(
@@ -46,7 +47,9 @@ export const SettingAbout = () => (

The icon library used by Follow is mgc which is copyrighted by - https://mgc.mingcute.com/ + + https://mgc.mingcute.com/ + {" "} and cannot be redistributed.

@@ -62,7 +65,7 @@ export const SettingAbout = () => ( {" "} open an issue