From 976018dd3211f377481f39a8e1cb98a9a6e287f6 Mon Sep 17 00:00:00 2001
From: Bohdan Triapitsyn
Date: Fri, 16 Jan 2026 14:43:53 +0200
Subject: [PATCH] feat: add copy diagnostics button
Add copy diagnostics button in About dialog.
Button copies report with OpenChamber state, OpenCode health, directories, and projects.
Show success or error toasts after copying attempt.
---
.../sections/openchamber/AboutSettings.tsx | 2 +
.../openchamber/OpenChamberSidebar.tsx | 1 +
packages/ui/src/components/ui/AboutDialog.tsx | 42 ++
packages/ui/src/lib/debug.ts | 29 ++
packages/ui/src/lib/directoryPersistence.ts | 3 +-
packages/ui/src/stores/useDirectoryStore.ts | 20 +-
packages/vscode/src/extension.ts | 31 +-
packages/vscode/src/opencode.ts | 73 ++--
packages/web/server/index.js | 365 ++++--------------
9 files changed, 234 insertions(+), 332 deletions(-)
diff --git a/packages/ui/src/components/sections/openchamber/AboutSettings.tsx b/packages/ui/src/components/sections/openchamber/AboutSettings.tsx
index 8477dffe..0d3357ca 100644
--- a/packages/ui/src/components/sections/openchamber/AboutSettings.tsx
+++ b/packages/ui/src/components/sections/openchamber/AboutSettings.tsx
@@ -138,6 +138,7 @@ export const AboutSettings: React.FC = () => {
);
}
+
// Desktop layout (unchanged)
return (
@@ -200,6 +201,7 @@ export const AboutSettings: React.FC = () => {
+ {/* Links */}
{/* Links */}
)}
+
);
};
diff --git a/packages/ui/src/components/ui/AboutDialog.tsx b/packages/ui/src/components/ui/AboutDialog.tsx
index e491bff7..5cf17a2a 100644
--- a/packages/ui/src/components/ui/AboutDialog.tsx
+++ b/packages/ui/src/components/ui/AboutDialog.tsx
@@ -5,6 +5,9 @@ import {
} from '@/components/ui/dialog';
import { OpenChamberLogo } from '@/components/ui/OpenChamberLogo';
import { RiDiscordFill, RiGithubFill, RiTwitterXFill } from '@remixicon/react';
+import { debugUtils } from '@/lib/debug';
+import { cn } from '@/lib/utils';
+import { toast } from 'sonner';
declare const __APP_VERSION__: string | undefined;
@@ -18,6 +21,28 @@ export const AboutDialog: React.FC = ({
onOpenChange,
}) => {
const [version, setVersion] = React.useState(null);
+ const [isCopyingDiagnostics, setIsCopyingDiagnostics] = React.useState(false);
+ const [copiedDiagnostics, setCopiedDiagnostics] = React.useState(false);
+
+ const handleCopyDiagnostics = React.useCallback(async () => {
+ if (isCopyingDiagnostics) return;
+ setIsCopyingDiagnostics(true);
+ setCopiedDiagnostics(false);
+ try {
+ const result = await debugUtils.copyDiagnosticsReport();
+ if (result.ok) {
+ setCopiedDiagnostics(true);
+ toast.success('Diagnostics copied');
+ } else {
+ toast.error('Copy failed');
+ }
+ } catch (error) {
+ toast.error('Copy failed');
+ console.error('Failed to copy diagnostics:', error);
+ } finally {
+ setIsCopyingDiagnostics(false);
+ }
+ }, [isCopyingDiagnostics]);
React.useEffect(() => {
if (!open) return;
@@ -70,6 +95,23 @@ export const AboutDialog: React.FC = ({
agent
+
+
+
+ Includes OpenChamber state, OpenCode health, directories, and projects.
+
+
+