+
+ );
+}
diff --git a/packages/webui/src/components/debug/live-activity.tsx b/packages/webui/src/components/debug/live-activity.tsx
index d407e675..eac53d87 100644
--- a/packages/webui/src/components/debug/live-activity.tsx
+++ b/packages/webui/src/components/debug/live-activity.tsx
@@ -25,7 +25,7 @@ function IconBtn({ onClick, title, children }: { onClick: () => void; title: str
);
}
-export function StatusPill({ status }: { status: 'open' | 'reconnecting' | 'closed' }) {
+function StatusPill({ status }: { status: 'open' | 'reconnecting' | 'closed' }) {
const map = {
open: { dot: 'bg-emerald-500', label: '已连接', glow: 'shadow-[0_0_0_3px_rgb(16_185_129/0.15)]' },
reconnecting: { dot: 'bg-amber-500', label: '重连中', glow: 'shadow-[0_0_0_3px_rgb(245_158_11/0.15)]' },
diff --git a/packages/webui/src/components/pages/debug-page.tsx b/packages/webui/src/components/pages/debug-page.tsx
index 88e115f4..a4c032a3 100644
--- a/packages/webui/src/components/pages/debug-page.tsx
+++ b/packages/webui/src/components/pages/debug-page.tsx
@@ -1,18 +1,27 @@
-// Debug — a standalone top-level page. The action tester and live activity are
-// extracted into their own components (ActionTester / LiveActivity); the
-// multi-tab console shell lands in a later phase. Apple-HIG flavour throughout.
+// Debug — a multi-tab developer console over /api/debug/*. Tabs: the action
+// tester, the visual message composer, the live activity feed, and an embedded
+// API browser. The browser's 试一下 prefills the tester and switches to it.
+// Apple-HIG flavour throughout (sliding-indicator tabs, translucent chrome).
import { useEffect, useState } from 'react';
import { motion } from 'motion/react';
-import { Bug } from 'lucide-react';
+import { BookOpen, Bug, FlaskConical, MessageSquarePlus, RadioTower } from 'lucide-react';
+import { cn } from '@/lib/utils';
+import { Tabs } from '@/components/ui/tabs';
import { ActionTester } from '@/components/debug/action-tester';
+import { MessageComposer } from '@/components/debug/message-composer';
import { LiveActivity } from '@/components/debug/live-activity';
+import { ApiBrowser } from '@/components/debug/api-browser';
import { useApi } from '@/lib/api';
import type { DebugActionDoc, QQInfo } from '@/types';
+type Tab = 'tester' | 'compose' | 'activity' | 'api';
+
export function DebugPage() {
const api = useApi();
const [accounts, setAccounts] = useState([]);
const [docs, setDocs] = useState([]);
+ const [tab, setTab] = useState('tester');
+ const [preset, setPreset] = useState<{ name: string; nonce: number } | undefined>();
useEffect(() => {
void (async () => {
@@ -24,11 +33,16 @@ export function DebugPage() {
})();
}, [api]);
+ const tryAction = (name: string) => {
+ setPreset((p) => ({ name, nonce: (p?.nonce ?? 0) + 1 }));
+ setTab('tester');
+ };
+
return (
@@ -36,13 +50,31 @@ export function DebugPage() {
调试
-
接口测试台与实时活动观测
+
接口测试 · 消息构建 · 实时观测 · API 参考
+ },
+ { value: 'compose', label: '消息构建', icon: },
+ { value: 'activity', label: '实时活动', icon: },
+ { value: 'api', label: 'API 浏览器', icon: , badge: docs.length || undefined },
+ ]}
+ />
-
-
+ {/* Tester / compose / activity stay MOUNTED and toggle via CSS so the
+ live feed's SSE never drops (it must capture events fired from other
+ tabs) and in-progress params/messages survive a peek at another tab.
+ ApiBrowser has no state worth preserving and is heavy (~520 rows), so
+ it mounts on demand. */}
+