feat(ui): 集成命令管理面板到 web 和 desktop

- 新增 CommandPanel 组件用于命令列表/搜索/CRUD
- 新增 CommandEditor 组件用于命令编辑/创建
- web/desktop 工具栏添加 Terminal 图标按钮
- 点击按钮打开命令管理面板
This commit is contained in:
2025-12-12 20:15:24 +08:00
parent 2973369778
commit 5a482f78ff
7 changed files with 847 additions and 4 deletions
+6
View File
@@ -7,6 +7,7 @@ import {
Sidebar,
FileBrowser,
ConfigPanel,
CommandPanel,
Toaster,
listSessions,
createSession,
@@ -19,6 +20,7 @@ export function App() {
const [isInitializing, setIsInitializing] = useState(true);
const [showFileBrowser, setShowFileBrowser] = useState(false);
const [showConfig, setShowConfig] = useState(false);
const [showCommands, setShowCommands] = useState(false);
const [sessionTitleUpdate, setSessionTitleUpdate] = useState<{ sessionId: string; name: string } | null>(null);
// 初始化:加载或创建会话
@@ -89,6 +91,7 @@ export function App() {
showFileBrowser={showFileBrowser}
onToggleFileBrowser={() => setShowFileBrowser(!showFileBrowser)}
onOpenConfig={() => setShowConfig(true)}
onOpenCommands={() => setShowCommands(true)}
/>
) : (
<div className="flex-1 flex items-center justify-center h-full">
@@ -112,6 +115,9 @@ export function App() {
{/* 配置面板 */}
{showConfig && <ConfigPanel onClose={() => setShowConfig(false)} />}
{/* 命令面板 */}
{showCommands && <CommandPanel onClose={() => setShowCommands(false)} />}
{/* Toast 通知 */}
<Toaster />
</div>