From dd3c71e3d5c8c1b9b23bcf3fdbc34dc306a80570 Mon Sep 17 00:00:00 2001
From: Adam Malczewski <github@tradam.dev>
Date: Mon, 1 Jun 2026 09:14:30 +0900
Subject: feat(sidebar): add Debug panel with copy-conversation action

New "Debug" panel option in the sidebar, grouping dev-facing actions.
Currently exposes the Copy-conversation button (ported from the old
header). Leaves room for additional debug actions without re-cluttering
the header.

The Copy action wraps `tabStore.copyConversation()` and shows a
"Copied"/"Failed" affordance for 1.5s, matching the previous header
behavior.
---
 .../frontend/src/lib/components/DebugPanel.svelte  | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 packages/frontend/src/lib/components/DebugPanel.svelte

(limited to 'packages/frontend/src/lib/components/DebugPanel.svelte')

diff --git a/packages/frontend/src/lib/components/DebugPanel.svelte b/packages/frontend/src/lib/components/DebugPanel.svelte
new file mode 100644
index 0000000..aea1ccb
--- /dev/null
+++ b/packages/frontend/src/lib/components/DebugPanel.svelte
@@ -0,0 +1,35 @@
+<script lang="ts">
+import { tabStore } from "../tabs.svelte.js";
+
+let copyLabel = $state("Copy conversation");
+
+function resetCopyLabel(): void {
+	copyLabel = "Copy conversation";
+}
+
+async function handleCopy(): Promise<void> {
+	const text = tabStore.copyConversation();
+	try {
+		await navigator.clipboard.writeText(text);
+		copyLabel = "Copied";
+	} catch {
+		copyLabel = "Failed";
+	}
+	setTimeout(resetCopyLabel, 1500);
+}
+</script>
+
+<div class="flex flex-col gap-3">
+	<div class="text-xs font-semibold text-base-content/50 uppercase tracking-wide">Debug</div>
+
+	<div class="flex flex-col gap-2">
+		<p class="text-xs text-base-content/70">Conversation</p>
+		<p class="text-xs text-base-content/40">
+			Copy a structured plain-text dump of the active tab's conversation
+			(chunk shape included) for bug reports.
+		</p>
+		<button type="button" class="btn btn-sm btn-primary w-full" onclick={handleCopy}>
+			{copyLabel}
+		</button>
+	</div>
+</div>
-- 
cgit v1.2.3

