Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(web): include instance diagnostics in feedback reports

tianma-if23c8947b261e
diff --git a/apps/web/src/components/settings/FeedbackLink.tsx b/apps/web/src/components/settings/FeedbackLink.tsx
index a4ceaf16..b08bbb8d 100644
--- a/apps/web/src/components/settings/FeedbackLink.tsx
+++ b/apps/web/src/components/settings/FeedbackLink.tsx
@@ -1,14 +1,36 @@
import { buildGitHubFeedbackUrl } from "@edgeever/shared";
import { useQuery } from "@tanstack/react-query";
-import { ExternalLink, MessageSquare } from "lucide-react";
+import { ExternalLink, LoaderCircle, MessageSquare } from "lucide-react";
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
+import { api, getConfiguredDesktopApiBaseUrl } from "@/lib/api";
import { getClientRuntimeDiagnostics } from "@/lib/system-diagnostics";
import { cn } from "@/lib/utils";
import { getShareableWebSystemInfoItems } from "./SystemInfoCard";
export const FeedbackLink = ({ className }: { className?: string }) => {
const { t, i18n } = useTranslation();
+ const instanceUrl = window.edgeeverDesktop?.isAvailable === true
+ ? getConfiguredDesktopApiBaseUrl()
+ : window.location.origin;
+ const healthQuery = useQuery({
+ queryKey: ["instance-health", instanceUrl],
+ queryFn: async () => {
+ const startedAt = performance.now();
+ const health = await api.getInstanceHealth();
+ return { health, latencyMs: Math.max(0, Math.round(performance.now() - startedAt)) };
+ },
+ enabled: Boolean(instanceUrl),
+ staleTime: 60 * 1000,
+ retry: 1,
+ });
+ const releaseQuery = useQuery({
+ queryKey: ["instance-release", instanceUrl],
+ queryFn: () => api.getInstanceRelease(),
+ enabled: Boolean(instanceUrl),
+ staleTime: 5 * 60 * 1000,
+ retry: 1,
+ });
const clientRuntimeQuery = useQuery({
queryKey: ["system-info-client-runtime"],
queryFn: getClientRuntimeDiagnostics,
@@ -23,13 +45,16 @@ export const FeedbackLink = ({ className }: { className?: string }) => {
privacyNotice: t("feedback.privacyNotice"),
systemInfo: getShareableWebSystemInfoItems(t, i18n.language, {
clientRuntime: clientRuntimeQuery.data,
+ instance: healthQuery.data?.health,
+ instanceVersion: releaseQuery.data?.version,
}),
systemInfoHeading: t("feedback.systemInfoHeading"),
systemInfoNotice: t("feedback.systemInfoNotice"),
titlePrefix: t("feedback.issueTitlePrefix"),
}),
- [clientRuntimeQuery.data, i18n.language, t]
+ [clientRuntimeQuery.data, healthQuery.data, i18n.language, releaseQuery.data, t]
);
+ const collectingSystemInfo = clientRuntimeQuery.isFetching || healthQuery.isFetching || releaseQuery.isFetching;
return (
<a
@@ -37,7 +62,10 @@ export const FeedbackLink = ({ className }: { className?: string }) => {
"flex min-h-16 w-full items-center justify-between gap-3 rounded-xl px-4 py-2.5 text-left text-xs font-normal leading-5 text-slate-600 transition-colors hover:bg-slate-200/50 hover:text-slate-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-900/20",
className
)}
- href={href}
+ href={collectingSystemInfo ? undefined : href}
+ aria-busy={collectingSystemInfo}
+ aria-disabled={collectingSystemInfo}
+ tabIndex={0}
target="_blank"
rel="noopener noreferrer"
>
@@ -47,10 +75,14 @@ export const FeedbackLink = ({ className }: { className?: string }) => {
</span>
<span className="min-w-0">
<span className="block truncate">{t("feedback.title")}</span>
- <span className="mt-0.5 block truncate text-xs font-normal text-slate-500">{t("feedback.description")}</span>
+ <span className="mt-0.5 block truncate text-xs font-normal text-slate-500">
+ {collectingSystemInfo ? t("systemInfo.connectionChecking") : t("feedback.description")}
+ </span>
</span>
</span>
- <ExternalLink className="h-4 w-4 shrink-0 text-slate-400" />
+ {collectingSystemInfo
+ ? <LoaderCircle className="h-4 w-4 shrink-0 animate-spin text-slate-400" />
+ : <ExternalLink className="h-4 w-4 shrink-0 text-slate-400" />}
</a>
);
};