diff --git a/src/hono.ts b/src/hono.ts index 44c1d801b..76d5cb951 100644 --- a/src/hono.ts +++ b/src/hono.ts @@ -3139,15 +3139,6 @@ declare const _routes: hono_hono_base.HonoBase}`]: { - input: Partial; - output: any; - outputFormat: string; - status: hono_utils_http_status.StatusCode; - }; - }; } & { [x: `/entries/read-histories/${string}`]: { [x: `$${Lowercase}`]: { @@ -3361,85 +3352,12 @@ declare const _routes: hono_hono_base.HonoBase}`]: { + input: Partial; + output: any; + outputFormat: string; + status: hono_utils_http_status.StatusCode; }; }; }, "/">; diff --git a/src/main/window.ts b/src/main/window.ts index b495fe3e7..0cd00ea6c 100644 --- a/src/main/window.ts +++ b/src/main/window.ts @@ -143,7 +143,7 @@ export function createWindow( { role: "selectAll", accelerator: "CmdOrCtrl+A" }, ]) - window.webContents.on("context-menu", (e, props) => { + window.webContents.on("context-menu", (_e, props) => { const { selectionText, isEditable } = props if (isEditable) { inputMenu.popup({ diff --git a/src/renderer/src/components/common/ErrorElement.tsx b/src/renderer/src/components/common/ErrorElement.tsx index 335c41a06..27ab5e41d 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 f67f6aa41..5d9e5228a 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 000000000..b26d6a70f --- /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/discover/import.tsx b/src/renderer/src/modules/discover/import.tsx index 22e2f1a2b..30bf1f5d4 100644 --- a/src/renderer/src/modules/discover/import.tsx +++ b/src/renderer/src/modules/discover/import.tsx @@ -67,7 +67,7 @@ export function DiscoverImport() { conflictItems: FeedResponseList parsedErrorItems: FeedResponseList } - }>("/import", { + }>("/subscriptions/import", { method: "POST", body: formData, }) diff --git a/src/renderer/src/modules/feed-column/item.tsx b/src/renderer/src/modules/feed-column/item.tsx index d4bf12696..9d9b1a200 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, + ) }} >