feat(webui): show commit and prefill bug report diagnostics (#6080)

* feat(webui): show gateway commit in About settings

* feat(webui): prefill revision in bug reports

* fix(webui): use parentheses for commit details

* feat(webui): prefill gateway diagnostics in bug reports

* docs: remove About settings explanation

* fix(webui): prefill dedicated issue diagnostic fields

* fix(docker): include revision helper in dependency build layer
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-06 18:53:50 +08:00
1 parent 42f06ab1dc
commit b0d28af321
12 files changed
+274 -56

No files matched your search

@@ -326,7 +326,7 @@ export function SettingsPage({
/>
);
case "about":
return <AboutSettings currentVersion={settings.version?.current} />;
return <AboutSettings settings={settings} />;
case "appearance":
return (
<AppearanceSettings
@@ -4,7 +4,7 @@ import {
ImageGenerationIcon,
VoiceIcon,
} from "@/components/icons/product-icons";
import { useState, type Dispatch, type SetStateAction } from "react";
import { useContext, useState, type Dispatch, type SetStateAction } from "react";
import {
ArrowUpCircle,
BookOpen,
@@ -18,6 +18,7 @@ import {
} from "lucide-react";
import { useTranslation } from "react-i18next";
import { HostNavigationContext } from "@/components/remote/HostSwitcher";
import { StarLink } from "@/components/StarPrompt";
import { LanguageSwitcher } from "@/components/LanguageSwitcher";
import { DEFAULT_TRANSCRIPTION_SETTINGS } from "@/components/settings/capabilities/TranscriptionSettings";
@@ -68,9 +69,9 @@ export function OverviewSettings({
? settings.agent.model
: tx("settings.values.notConfigured", "Not configured");
const activeModelCaption = activeProviderConfigured
? [activeProvider, activePreset].filter(Boolean).join(" · ")
? [activeProvider, activePreset].filter(Boolean).join(" ")
: activeProviderLabel || settings.agent.model
? [activeProviderLabel, settings.agent.model].filter(Boolean).join(" · ")
? [activeProviderLabel, settings.agent.model].filter(Boolean).join(" ")
: tx("settings.byok.noConfiguredProviders", "No configured providers");
const webStatus = settings.web.enable
? tx("settings.values.enabled", "Enabled")
@@ -137,19 +138,44 @@ export function OverviewSettings({
);
}
export function AboutSettings({ currentVersion }: { currentVersion?: string }) {
type VersionInfoProps = { currentVersion?: string; currentCommit?: string | null };
export function AboutSettings({ settings }: { settings: SettingsPayload }) {
const { t } = useTranslation();
const hostPicker = useContext(HostNavigationContext);
const currentVersion = settings.version?.current;
const currentCommit = settings.version?.commit;
const environment = settings.environment;
const reportIssueUrl = new URL("https://github.com/HKUDS/nanobot/issues/new");
reportIssueUrl.searchParams.set("template", "bug_report.yml");
const reportedVersion = [currentVersion, currentCommit && `(commit ${currentCommit})`]
.filter(Boolean).join(" ");
if (reportedVersion) reportIssueUrl.searchParams.set("version", reportedVersion);
reportIssueUrl.searchParams.set("channel", "WebSocket");
if (environment) {
reportIssueUrl.searchParams.set("python_version", environment.python_version);
const osName = environment.os === "Darwin" ? "macOS" : environment.os;
const osVersion = [osName, environment.os_version].filter(Boolean).join(" ");
reportIssueUrl.searchParams.set("os", environment.architecture
? `${osVersion} (${environment.architecture})` : osVersion);
}
if (settings.agent.model) reportIssueUrl.searchParams.set("model", settings.agent.model);
const provider = settings.agent.resolved_provider || settings.agent.provider;
if (provider) reportIssueUrl.searchParams.set("llm_provider", provider);
reportIssueUrl.searchParams.set("browser", navigator.userAgent);
reportIssueUrl.searchParams.set("connection", hostPicker?.kind === "embedded"
? "Remote host" : hostPicker ? "Local host" : "Direct WebUI");
const links = [
{ key: "sourceCode", icon: Github, href: "https://github.com/HKUDS/nanobot" },
{ key: "documentation", icon: BookOpen, href: "https://nanobot.wiki/" },
{ key: "reportIssue", icon: MessageCircle, href: "https://github.com/HKUDS/nanobot/issues" },
{ key: "reportIssue", icon: MessageCircle, href: reportIssueUrl.href },
];
return (
<div className="flex flex-1 flex-col gap-5">
<div className="flex flex-col items-center gap-4 py-6 text-center">
<img src="/brand/nanobot_mark.svg" alt="" className="h-16 w-16 select-none" draggable={false} />
<h1><img src="/brand/nanobot_wordmark.svg" alt="nanobot" className="h-auto w-40 select-none dark:brightness-150" draggable={false} /></h1>
<VersionCheckRow currentVersion={currentVersion} />
<VersionCheckRow currentVersion={currentVersion} currentCommit={currentCommit} />
</div>
<SettingsGroup>
{links.map(({ key, icon: Icon, href }) => (
@@ -168,7 +194,7 @@ export function AboutSettings({ currentVersion }: { currentVersion?: string }) {
);
}
function VersionCheckRow({ currentVersion }: { currentVersion?: string }) {
function VersionCheckRow({ currentVersion, currentCommit }: VersionInfoProps) {
const { t } = useTranslation();
const tx = (key: string, fallback: string) => t(key, { defaultValue: fallback });
const { token } = useClient();
@@ -209,6 +235,17 @@ function VersionCheckRow({ currentVersion }: { currentVersion?: string }) {
</div>
<div className="mt-0.5 text-[12px] leading-5 text-muted-foreground">
{currentVersion ? `v${currentVersion}` : "nanobot"}
{currentCommit && (
<>
<span aria-hidden> (</span>
<a href={`https://github.com/HKUDS/nanobot/commit/${currentCommit}`}
target="_blank" rel="noopener noreferrer" title={currentCommit}
className="font-mono hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
{currentCommit.slice(0, 7)}
</a>
<span aria-hidden>)</span>
</>
)}
</div>
</div>
<div className="flex shrink-0 flex-col items-center gap-2">