diff --git a/packages/desktop/electron/main.ts b/packages/desktop/electron/main.ts index 4e88404c..ef7d5c11 100644 --- a/packages/desktop/electron/main.ts +++ b/packages/desktop/electron/main.ts @@ -19,14 +19,15 @@ function createWindow(apiPort: number): BrowserWindow { const win = new BrowserWindow({ width: 1280, height: 800, - backgroundColor: '#1e1e1e', + backgroundColor: '#0d1015', titleBarStyle: 'hidden', trafficLightPosition: { x: 12, y: 12 }, ...(process.platform === 'win32' ? { titleBarOverlay: { - color: '#1a1a1a', - symbolColor: '#858585', + color: '#0d101500', + symbolColor: '#8996a6', + height: 36, }, } : {}), @@ -80,9 +81,9 @@ app.whenReady().then(async () => { // Theme sync: update window background and title bar overlay const themeColors = { - dark: { bg: '#1e1e1e', overlay: '#1a1a1a', symbol: '#858585' }, - light: { bg: '#ffffff', overlay: '#f5f5f5', symbol: '#666666' }, - paper: { bg: '#f5f0e8', overlay: '#ede8de', symbol: '#7a7872' }, + dark: { bg: '#0d1015', overlay: '#0d101500', symbol: '#8996a6' }, + light: { bg: '#f3f6f8', overlay: '#f3f6f800', symbol: '#687580' }, + paper: { bg: '#f5f0e8', overlay: '#f5f0e800', symbol: '#7a7872' }, }; ipcMain.on('theme:change', (_e, theme: string) => { diff --git a/packages/desktop/src/App.tsx b/packages/desktop/src/App.tsx index 2bda5e1f..e8181267 100644 --- a/packages/desktop/src/App.tsx +++ b/packages/desktop/src/App.tsx @@ -2,10 +2,10 @@ import { useEffect } from 'react'; import { useAgentCore } from './hooks/useAgent'; import { useUIStore } from './stores/ui.store'; import { useWorkspaceStore } from './stores/workspace.store'; +import { AutomationPanel } from './agent/AutomationPanel'; import ProjectStrip from './agent/ProjectStrip'; import AgentSidebar from './agent/AgentSidebar'; import AgentWorkspace from './agent/AgentWorkspace'; -import { AutomationPanel } from './agent/AutomationPanel'; import GlobalSettingsPage from './settings/GlobalSettingsPage'; import ProjectSettingsPage from './settings/ProjectSettingsPage'; import TitleBar from './TitleBar'; @@ -17,14 +17,12 @@ export default function App() { const view = useUIStore((s) => s.view); const rootPath = useWorkspaceStore((s) => s.rootPath); - // Sync workspace cwd to main process for git polling useEffect(() => { if (rootPath) { window.electronAPI?.setWorkspaceCwd?.(rootPath); } }, [rootPath]); - // Sync theme to document and main process useEffect(() => { document.documentElement.dataset.theme = theme; window.electronAPI?.setTheme?.(theme); @@ -37,28 +35,30 @@ export default function App() { }; }, []); - let content; + let page; if (view === 'global-settings') { - content = ; + page = ; } else if (view === 'project-settings') { - content = ; + page = ; } else if (view === 'automation') { - content = ; + page = ; } else { - content = ( -
- + page = ( + <> -
+ ); } return ( -
+
-
{content}
+
+ +
{page}
+
); diff --git a/packages/desktop/src/TitleBar.tsx b/packages/desktop/src/TitleBar.tsx index 6867e1ae..dd35da46 100644 --- a/packages/desktop/src/TitleBar.tsx +++ b/packages/desktop/src/TitleBar.tsx @@ -3,7 +3,7 @@ export default function TitleBar() { return (
- Coding Code + Coding Code
); } diff --git a/packages/desktop/src/agent/AgentSidebar.tsx b/packages/desktop/src/agent/AgentSidebar.tsx index 6c6f9ebd..ae8752e1 100644 --- a/packages/desktop/src/agent/AgentSidebar.tsx +++ b/packages/desktop/src/agent/AgentSidebar.tsx @@ -1,5 +1,5 @@ import { useState, useMemo } from 'react'; -import { Plus, Search, Zap, Settings } from 'lucide-react'; +import { ChevronDown, FolderOpen, Plus, Settings, Trash2 } from 'lucide-react'; import { useUIStore } from '../stores/ui.store'; import { useWorkspaceStore } from '../stores/workspace.store'; import { useAgentStore } from '../stores/agent.store'; @@ -26,9 +26,12 @@ export default function AgentSidebar() { const workspace = useWorkspaceStore(); const setView = useUIStore((s) => s.setView); const setCurrentThread = useAgentStore((s) => s.setCurrentThread); + const switchProject = useWorkspaceStore((s) => s.switchProject); + const addProject = useWorkspaceStore((s) => s.addProject); const { deleteThread } = useAgentRollback(); + const [projectMenuOpen, setProjectMenuOpen] = useState(false); + const [hoveredThreadId, setHoveredThreadId] = useState(null); - // Subscribe to raw threads, derive list with useMemo for stable reference const rawThreads = useAgentStore((s) => s.threads); const threadList = useMemo(() => { const normalizedRoot = normalizeCwd(rootPath); @@ -38,152 +41,120 @@ export default function AgentSidebar() { .sort((a, b) => b.updatedAt - a.updatedAt); }, [rawThreads, rootPath]); - const [hoveredThreadId, setHoveredThreadId] = useState(null); + const currentProject = workspace.projects.find((p) => p.id === workspace.currentProjectId); + const projectName = currentProject?.name || workspace.name || '项目'; - const handleDelete = (threadId: string) => { - void deleteThread(threadId); + const handleAddProject = async () => { + const folder = await window.electronAPI?.openFolderDialog?.(); + if (!folder) return; + const name = folder.replace(/\\/g, '/').split('/').pop() || folder; + const project = { id: crypto.randomUUID(), name, rootPath: folder }; + addProject(project); + switchProject(project.id); + setProjectMenuOpen(false); }; - // Find current project name - const currentProject = workspace.projects.find((p) => p.id === workspace.currentProjectId); - const projectName = currentProject?.name || workspace.name; - - if (sidebarCollapsed) { - return null; - } + if (sidebarCollapsed) return null; return ( -
- {/* 顶部栏:项目名 + 项目级设置按钮 */} -
- - {projectName || '项目'} - - -
- - {/* 新对话 */} -
+ ); } diff --git a/packages/desktop/src/agent/AgentWorkspace.tsx b/packages/desktop/src/agent/AgentWorkspace.tsx index 2176723d..a806e6c2 100644 --- a/packages/desktop/src/agent/AgentWorkspace.tsx +++ b/packages/desktop/src/agent/AgentWorkspace.tsx @@ -541,7 +541,7 @@ function InputBox({ return ( -
+
{queuedInputs.length > 0 && currentThreadId && (
{queuedInputs.map((item, index) => ( @@ -666,7 +666,7 @@ function InputBox({ } }} placeholder="可向 AI 询问任何事" - rows={3} + rows={1} className="flex-1 bg-transparent px-5 pt-4 pb-3 text-[15px] text-[var(--text-primary)] placeholder-[var(--text-disabled)] resize-none outline-none leading-relaxed disabled:opacity-50" /> {/* 附件:选文件入口,accept 取当前模型可达格式 */} @@ -861,7 +861,7 @@ export default function AgentWorkspace({ sendMessage, sendQueuedInput, abort }: if (!currentThreadId) { return ( -
+

在{' '} @@ -875,8 +875,8 @@ export default function AgentWorkspace({ sendMessage, sendQueuedInput, abort }: } return ( -
-
+
+
diff --git a/packages/desktop/src/agent/AutomationPanel.tsx b/packages/desktop/src/agent/AutomationPanel.tsx index 56c231c9..fcd150bd 100644 --- a/packages/desktop/src/agent/AutomationPanel.tsx +++ b/packages/desktop/src/agent/AutomationPanel.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react'; -import { ArrowLeft, Plus, Play, Trash2, Power, Clock, FolderOpen } from 'lucide-react'; +import { Clock3, FolderOpen, Play, Plus, Power, Trash2, Pencil } from 'lucide-react'; import { useAgentStore } from '../stores/agent.store'; import { useWorkspaceStore } from '../stores/workspace.store'; import { useUIStore } from '../stores/ui.store'; @@ -12,16 +12,16 @@ import { import { AutomationForm } from './AutomationForm'; export function AutomationPanel() { + const sidebarCollapsed = useUIStore((s) => s.sidebarCollapsed); const automations = useAgentStore((s) => s.automations); const setAutomations = useAgentStore((s) => s.setAutomations); const workspace = useWorkspaceStore(); - const setView = useUIStore((s) => s.setView); const [showForm, setShowForm] = useState(false); const [editingId, setEditingId] = useState(null); const [loading, setLoading] = useState(false); useEffect(() => { - loadAutomations(); + void loadAutomations(); }, []); async function loadAutomations() { @@ -75,12 +75,8 @@ export function AutomationPanel() { if (day !== '*' && month !== '*') { return `${month}月${day}日 ${hour}:${min.padStart(2, '0')}`; } - if (hour.startsWith('*/')) { - return `每 ${hour.slice(2)} 小时`; - } - if (min.startsWith('*/')) { - return `每 ${min.slice(2)} 分钟`; - } + if (hour.startsWith('*/')) return `每 ${hour.slice(2)} 小时`; + if (min.startsWith('*/')) return `每 ${min.slice(2)} 分钟`; return `每天 ${hour}:${min.padStart(2, '0')}`; } @@ -91,157 +87,103 @@ export function AutomationPanel() { const isToday = d.toDateString() === now.toDateString(); const time = d.toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit' }); if (isToday) return time; - return d.toLocaleDateString('zh-CN', { month: '2-digit', day: '2-digit' }) + ' ' + time; + return `${d.toLocaleDateString('zh-CN', { month: '2-digit', day: '2-digit' })} ${time}`; } + const openNewForm = () => { + setEditingId(null); + setShowForm(true); + }; + return ( -
- {/* Header */} -
-
- +
+
+
+ 计划任务 + {automations.length} +
+
+ {automations.map((auto) => ( + + ))} + {automations.length === 0 &&
暂无计划任务
} +
+ + )} + +
+
+
+
自动化
+

计划任务

+
+ - 自动化任务
- -
- {/* Content */} -
- {automations.length === 0 ? ( -
- -

暂无自动化任务

-

点击"新建"创建定时任务

-
- ) : ( -
- {automations.map((auto) => ( -
-
-
-
- - {auto.name} - - - {auto.enabled ? '启用' : '禁用'} - - {auto.runOnce && ( - - 单次 - - )} -
-
- {formatCronHuman(auto.cron)} · {auto.timezone} +
+ {automations.length === 0 ? ( +
+
+ +
+

暂无自动化任务

+

创建一个计划任务,让 Coding Code 在指定时间自动执行工作。

+
+ ) : ( +
+ {automations.map((auto) => ( +
+
+
+
+ {auto.name} + {auto.enabled ? '启用' : '禁用'} + {auto.runOnce && 单次} +
+
{formatCronHuman(auto.cron)} · {auto.timezone}
+

{auto.description}

+
+ {auto.projectCwd.split(/[/\\]/).pop() || auto.projectCwd} + 上次执行 {formatTime(auto.lastRunAt)} +
-

- {auto.description} -

-
- - - {auto.projectCwd.split(/[/\\]/).pop() || auto.projectCwd} - - 上次: {formatTime(auto.lastRunAt)} +
+ + + +
- -
- - - - -
-
- ))} -
- )} -
+ ))} +
+ )} +
+ {showForm && ( { - setShowForm(false); - setEditingId(null); - }} - onSaved={() => { - setShowForm(false); - setEditingId(null); - loadAutomations(); - }} + onClose={() => { setShowForm(false); setEditingId(null); }} + onSaved={() => { setShowForm(false); setEditingId(null); void loadAutomations(); }} /> )}
diff --git a/packages/desktop/src/agent/MessageStream.tsx b/packages/desktop/src/agent/MessageStream.tsx index 69393ee2..492003f8 100644 --- a/packages/desktop/src/agent/MessageStream.tsx +++ b/packages/desktop/src/agent/MessageStream.tsx @@ -5,6 +5,7 @@ import { useShallow } from 'zustand/react/shallow'; import { useAgentStore } from '../stores/agent.store'; import { useRollbackStore, TURN_SCOPE_REVERTED } from '../stores/rollback.store'; import MessageItem from '../shared/MessageItem'; +import ToolCallGroup, { type ToolCallEntry } from '../shared/ToolCallGroup'; import UnifiedDiffView from '../shared/UnifiedDiffView'; import type { Item } from '@shared/types'; import { textOf } from '@shared/parts'; @@ -22,6 +23,7 @@ interface TurnDiffPanelProps { uiTurnId: string; isInterrupted?: boolean; threadId: string; + cwd: string; onRevertFile: (uiTurnId: string, file: string, checkpointTurnId: number) => void; onRevertTurn: (uiTurnId: string, checkpointTurnId: number) => void; onUndoRevertFile: (uiTurnId: string, file: string, checkpointTurnId: number) => void; @@ -57,6 +59,7 @@ function TurnDiffPanel({ uiTurnId, isInterrupted, threadId, + cwd, onRevertFile, onRevertTurn, onUndoRevertFile, @@ -82,6 +85,15 @@ function TurnDiffPanel({ const isTurnReverted = revertedFiles.includes(TURN_SCOPE_REVERTED); const [expandedFile, setExpandedFile] = useState(null); + const displayPath = (filePath: string) => { + const normalizedPath = filePath.replace(/\\/g, '/'); + const normalizedCwd = cwd.replace(/\\/g, '/').replace(/\/$/, ''); + const prefix = `${normalizedCwd.toLowerCase()}/`; + return normalizedCwd && normalizedPath.toLowerCase().startsWith(prefix) + ? normalizedPath.slice(normalizedCwd.length + 1) + : normalizedPath; + }; + if (!diff || !diff.files || diff.files.length === 0) { return null; } @@ -159,7 +171,7 @@ function TurnDiffPanel({ >
- {f.path.replace(/\\/g, '/')} + {displayPath(f.path)} {isReverted && ( 已回退 @@ -192,21 +204,6 @@ function TurnDiffPanel({ > {isReverted ? '撤销回退' : '回退'} - - -
{isExpanded && ( @@ -260,7 +257,7 @@ export default function MessageStream({ threadId }: MessageStreamProps) { turns .map( (t) => - `${t.id}:${t.status}:${t.items.length}:${t.items.map((i) => `${i.type}:${i.id}`).join(',')}` + `${t.id}:${t.status}:${t.items.length}:${t.items.map((i) => `${i.type}:${i.id}:${i.type === 'tool_call' ? i.status : ''}`).join(',')}` ) .join('|'), [turns] @@ -274,8 +271,10 @@ export default function MessageStream({ threadId }: MessageStreamProps) { assistantContentByTurnId, } = useMemo(() => { const entries: Array<{ - item: Item; + item?: Item; + toolCalls?: ToolCallEntry[]; turnId: string; + turnIds: string[]; toolResult?: Item & { type: 'tool_result' }; key: string; }> = []; @@ -302,20 +301,37 @@ export default function MessageStream({ threadId }: MessageStreamProps) { contentMap.set(turn.id, assistantParts.join('\n\n')); } } - for (const turn of turns) { - for (const item of turn.items) { - if (item.type === 'tool_result') continue; - if (item.type === 'tool_call') { - entries.push({ - item, - turnId: turn.id, - toolResult: toolResultByCallId[item.id], - key: item.id, - }); - } else { - entries.push({ item, turnId: turn.id, key: item.id }); + const visibleItems = turns.flatMap((turn) => + turn.items + .filter((item) => item.type !== 'tool_result') + .map((item) => ({ item, turnId: turn.id })) + ); + + for (let index = 0; index < visibleItems.length; index += 1) { + const current = visibleItems[index]!; + if (current.item.type === 'tool_call') { + const toolCalls: ToolCallEntry[] = []; + const turnIds: string[] = []; + while (index < visibleItems.length && visibleItems[index]?.item.type === 'tool_call') { + const next = visibleItems[index]!; + const toolCall = next.item as Item & { type: 'tool_call' }; + toolCalls.push({ item: toolCall, toolResult: toolResultByCallId[toolCall.id] }); + if (!turnIds.includes(next.turnId)) turnIds.push(next.turnId); + index += 1; } - countMap.set(turn.id, (countMap.get(turn.id) ?? 0) + 1); + index -= 1; + entries.push({ + toolCalls, + turnId: turnIds[turnIds.length - 1]!, + turnIds, + key: `tool-group:${turnIds[0]}:${toolCalls[0]!.item.id}`, + }); + for (const turnId of turnIds) { + countMap.set(turnId, (countMap.get(turnId) ?? 0) + 1); + } + } else { + entries.push({ item: current.item, turnId: current.turnId, turnIds: [current.turnId], key: current.item.id }); + countMap.set(current.turnId, (countMap.get(current.turnId) ?? 0) + 1); } } @@ -337,10 +353,14 @@ export default function MessageStream({ threadId }: MessageStreamProps) { onForkFromHere?: () => void; } >(); - let idx = 0; + const lastEntryByTurnId = new Map(); + renderEntries.forEach((entry, index) => { + for (const turnId of entry.turnIds) lastEntryByTurnId.set(turnId, index); + }); for (const turn of turns) { - const turnEntryCount = entryCountByTurnId.get(turn.id) ?? 0; - idx += turnEntryCount - 1; + const idx = lastEntryByTurnId.get(turn.id); + if (idx === undefined) continue; + if (turn.status === 'completed' || turn.status === 'error') { endIndices.add(idx); const turnNum = parseInt(turn.id, 10); @@ -400,12 +420,11 @@ export default function MessageStream({ threadId }: MessageStreamProps) { }, }); } - idx++; } return { turnEndIndices: endIndices, turnRollbackCallbacks: rollbackCbs }; }, [ turnsStructureKey, - entryCountByTurnId, + renderEntries, threadId, previewRollback, forkThread, @@ -568,7 +587,7 @@ export default function MessageStream({ threadId }: MessageStreamProps) { if (!entry) return null; const isLastInTurn = turnEndIndices.has(virtualRow.index); const cbs = turnRollbackCallbacks.get(entry.turnId); - const isUserMsg = entry.item.type === 'message' && entry.item.role === 'user'; + const isUserMsg = entry.item?.type === 'message' && entry.item.role === 'user'; const turn = turnById.get(entry.turnId); const isInterrupted = turn?.status === 'error'; @@ -586,17 +605,21 @@ export default function MessageStream({ threadId }: MessageStreamProps) { }} >
- + {entry.toolCalls ? ( + + ) : entry.item ? ( + + ) : null}
{isLastInTurn && (() => { @@ -629,11 +652,12 @@ export default function MessageStream({ threadId }: MessageStreamProps) { ); })()} {isLastInTurn && ( -
+
`${l.toLowerCase()}:`); -} - -const PROJECT_COLORS = [ - 'bg-blue-600', - 'bg-emerald-600', - 'bg-violet-600', - 'bg-amber-600', - 'bg-rose-600', - 'bg-cyan-600', - 'bg-fuchsia-600', - 'bg-lime-600', -]; - -function colorForId(id: string): string { - let hash = 0; - for (let i = 0; i < id.length; i++) hash = ((hash << 5) - hash + id.charCodeAt(i)) | 0; - return PROJECT_COLORS[Math.abs(hash) % PROJECT_COLORS.length]!; -} - -function relativeTime(ts: number): string { - const diff = Date.now() - ts; - if (diff < 60000) return '刚刚'; - if (diff < 3600000) return `${Math.floor(diff / 60000)}分钟前`; - if (diff < 86400000) return `${Math.floor(diff / 3600000)}小时前`; - const days = Math.floor(diff / 86400000); - if (days < 7) return `${days}天`; - return `${Math.floor(days / 7)}周`; -} - -interface SessionListPopupProps { - project: Project; - threads: Thread[]; - currentThreadId: string | null; - onSelectThread: (id: string) => void; - onDeleteThread: (threadId: string) => void; -} - -function SessionListPopup({ - project, - threads, - currentThreadId, - onSelectThread, - onDeleteThread, -}: SessionListPopupProps) { - const sorted = [...threads].sort((a, b) => b.updatedAt - a.updatedAt); - const [hoveredId, setHoveredId] = useState(null); - return ( -
-
- - {project.name} - -
-
- {sorted.slice(0, 12).map((t) => ( - - ) : ( - - {relativeTime(t.updatedAt)} - - )} - - ))} - {sorted.length === 0 && ( -
暂无对话
- )} - {sorted.length > 12 && ( -
- +{sorted.length - 12} 条更多 -
- )} -
-
- ); -} export default function ProjectStrip() { - const projects = useWorkspaceStore((s) => s.projects); - const currentProjectId = useWorkspaceStore((s) => s.currentProjectId); - const rawThreads = useAgentStore((s) => s.threads); - const threadMetadata = useMemo(() => { - return Object.values(rawThreads).map((t) => ({ - id: t.id, - title: t.title, - cwd: t.cwd, - updatedAt: t.updatedAt, - })); - }, [rawThreads]); - const currentThreadId = useAgentStore((s) => s.currentThreadId); + const view = useUIStore((s) => s.view); const sidebarCollapsed = useUIStore((s) => s.sidebarCollapsed); - const switchProject = useWorkspaceStore((s) => s.switchProject); - const addProject = useWorkspaceStore((s) => s.addProject); - const setCurrentThread = useAgentStore((s) => s.setCurrentThread); const setView = useUIStore((s) => s.setView); const toggleSidebar = useUIStore((s) => s.toggleSidebar); - const { deleteThread } = useAgentRollback(); - - const [hoveredId, setHoveredId] = useState(null); - - const handleDelete = (threadId: string) => { - void deleteThread(threadId); - }; - const handleSelectProject = (id: string) => { - switchProject(id); - }; - - const handleAddProject = async () => { - const folder = await window.electronAPI?.openFolderDialog?.(); - if (!folder) return; - const name = folder.replace(/\\/g, '/').split('/').pop() || folder; - const project: Project = { id: crypto.randomUUID(), name, rootPath: folder }; - addProject(project); - switchProject(project.id); - }; - - const getThreadsForProject = (rootPath: string): Thread[] => { - const normalizedRoot = normalizeCwd(rootPath); - return threadMetadata.filter((t) => { - const tcwd = normalizeCwd(t.cwd); - return tcwd.startsWith(normalizedRoot); - }) as Thread[]; + const handleNavigation = (target: 'agent' | 'automation') => { + if (view === target) { + toggleSidebar(); + return; + } + setView(target); }; return ( -
- {projects.map((p) => { - const isActive = p.id === currentProjectId; - const colorClass = colorForId(p.id); - return ( -
(sidebarCollapsed ? setHoveredId(p.id) : null)} - onMouseLeave={() => setHoveredId(null)} - > - - {sidebarCollapsed && hoveredId === p.id && ( - { - setCurrentThread(tid); - setHoveredId(null); - }} - onDeleteThread={handleDelete} - /> - )} -
- ); - })} - - {/* Divider before add button */} - {projects.length > 0 &&
} - + ); } diff --git a/packages/desktop/src/settings/GlobalSettingsPage.tsx b/packages/desktop/src/settings/GlobalSettingsPage.tsx index 09d6739d..1bcddea0 100644 --- a/packages/desktop/src/settings/GlobalSettingsPage.tsx +++ b/packages/desktop/src/settings/GlobalSettingsPage.tsx @@ -1,6 +1,6 @@ -import { ArrowLeft } from 'lucide-react'; -import { useUIStore } from '../stores/ui.store'; import { useState } from 'react'; + +import { useUIStore } from '../stores/ui.store'; import McpPanel from './McpPanel'; import HooksPanel from './HooksPanel'; import SkillPanel from './SkillPanel'; @@ -23,22 +23,14 @@ const THEMES = [ ]; export default function GlobalSettingsPage() { - const setView = useUIStore((s) => s.setView); const [section, setSection] = useState
('theme'); const theme = useUIStore((s) => s.theme); const setTheme = useUIStore((s) => s.setTheme); return ( -
+
{/* Header */} -
- +
全局设置
diff --git a/packages/desktop/src/settings/ProjectSettingsPage.tsx b/packages/desktop/src/settings/ProjectSettingsPage.tsx index cf5fb4e9..fe65d78b 100644 --- a/packages/desktop/src/settings/ProjectSettingsPage.tsx +++ b/packages/desktop/src/settings/ProjectSettingsPage.tsx @@ -1,6 +1,5 @@ -import { ArrowLeft } from 'lucide-react'; -import { useUIStore } from '../stores/ui.store'; import { useState } from 'react'; +import { useWorkspaceStore } from '../stores/workspace.store'; import McpPanel from './McpPanel'; import HooksPanel from './HooksPanel'; import SkillPanel from './SkillPanel'; @@ -16,21 +15,15 @@ const NAV_ITEMS: { id: Section; label: string }[] = [ ]; export default function ProjectSettingsPage() { - const setView = useUIStore((s) => s.setView); const [section, setSection] = useState
('mcp'); + const workspace = useWorkspaceStore(); + const projectName = workspace.name || workspace.projects.find((p) => p.id === workspace.currentProjectId)?.name || '项目'; return ( -
+
{/* Header */} -
- - 项目设置 +
+ 项目设置 · {projectName}
diff --git a/packages/desktop/src/shared/DiffBlock.tsx b/packages/desktop/src/shared/DiffBlock.tsx index 5b6dfdcd..ae44ca78 100644 --- a/packages/desktop/src/shared/DiffBlock.tsx +++ b/packages/desktop/src/shared/DiffBlock.tsx @@ -10,7 +10,7 @@ export default function DiffBlock({ diff }: DiffBlockProps) { const lines = parsed.flatMap((f) => f.hunks.flatMap((h) => h.lines)); return ( -
+
         {lines.map((line, idx) => {
           const { type, text } = line;
diff --git a/packages/desktop/src/shared/MessageItem.tsx b/packages/desktop/src/shared/MessageItem.tsx
index ae94868c..ad95137d 100644
--- a/packages/desktop/src/shared/MessageItem.tsx
+++ b/packages/desktop/src/shared/MessageItem.tsx
@@ -93,8 +93,8 @@ const MessageItem = memo(function MessageItem({
     if (isUser) {
       const mediaParts = parts.filter((p) => p.type === 'media');
       return (
-        
-
+
+
{mediaParts.map((p, i) => ( @@ -199,7 +199,7 @@ const MessageItem = memo(function MessageItem({ } return ( -
+
{text && (
@@ -214,7 +214,7 @@ const MessageItem = memo(function MessageItem({ if (item.type === 'reasoning') { return ( -
+
+ {open && ( +
+ {entries.map(({ item, toolResult }) => ( +
+ {toolResult ? ( + + ) : ( +
+ + {item.name} + {pendingLabel(item) === item.name ? '' : pendingLabel(item)} + + {item.status === 'pending' ? '等待审批' : item.status === 'running' ? '执行中' : '已拒绝'} + +
+ )} +
+ ))} +
+ )} +
+ ); +} diff --git a/packages/desktop/src/shared/ToolSummary.tsx b/packages/desktop/src/shared/ToolSummary.tsx index 0795a09c..af9384c9 100644 --- a/packages/desktop/src/shared/ToolSummary.tsx +++ b/packages/desktop/src/shared/ToolSummary.tsx @@ -1,5 +1,5 @@ import { useState, useMemo } from 'react'; -import { ChevronRight, ChevronDown } from 'lucide-react'; +import { ChevronRight, ChevronDown, FilePenLine, FileText, Folder, Globe, Search, Terminal, Wrench } from 'lucide-react'; import type { Item } from '@shared/types'; import { buildToolDiff } from '../lib/diff-compute'; import CodeBlock from './CodeBlock'; @@ -25,6 +25,25 @@ function getSearchQuery(args: object): string | null { return typeof a.query === 'string' ? a.query : typeof a.regex === 'string' ? a.regex : null; } +function formatToolArgs(args: object): string { + try { + const text = JSON.stringify(args); + return text && text !== '{}' ? text : ''; + } catch { + return ''; + } +} + +function toolIcon(name: string) { + if (name === 'read_file') return FileText; + if (name === 'write_file' || name === 'edit_file') return FilePenLine; + if (name === 'list_dir') return Folder; + if (name === 'search_files' || name === 'grep_search') return Search; + if (name === 'shell' || name === 'bash' || name === 'execute_command') return Terminal; + if (name.includes('url') || name.includes('web') || name.includes('fetch')) return Globe; + return Wrench; +} + export function buildToolSummaryTitle( toolCall: Item & { type: 'tool_call' }, toolResult?: Item & { type: 'tool_result' } @@ -105,7 +124,9 @@ export default function ToolSummary({ toolCall, toolResult }: ToolSummaryProps) }, [toolResult, toolCall, isFileTool]); const effectiveResult = computedResult ?? toolResult; - const { title, isError, isRejected } = buildToolSummaryTitle(toolCall, effectiveResult); + const { isError, isRejected } = buildToolSummaryTitle(toolCall, effectiveResult); + const argsSummary = formatToolArgs(toolCall.args); + const ToolIcon = toolIcon(toolCall.name); const titleColor = isRejected ? 'text-[var(--text-muted)] line-through' @@ -116,18 +137,15 @@ export default function ToolSummary({ toolCall, toolResult }: ToolSummaryProps) const hasContent = !!(effectiveResult?.diff || effectiveResult?.output); return ( -
+
{open && hasContent && (
diff --git a/packages/desktop/src/shared/UnifiedDiffView.tsx b/packages/desktop/src/shared/UnifiedDiffView.tsx index eaeede3b..8244ada2 100644 --- a/packages/desktop/src/shared/UnifiedDiffView.tsx +++ b/packages/desktop/src/shared/UnifiedDiffView.tsx @@ -1,4 +1,4 @@ -import { useState, useMemo } from 'react'; +import { useMemo } from 'react'; import { parseUnifiedDiff } from '../lib/diff-parser'; interface UnifiedDiffViewProps { @@ -53,26 +53,9 @@ function DiffLineView({ } function DiffFileView({ file }: { file: import('../lib/diff-parser').ParsedDiffFile }) { - const [collapsed, setCollapsed] = useState(false); - return (
- {/* File header */} - - - {!collapsed && ( -
+
{file.hunks.length === 0 && (
无差异
)} @@ -97,8 +80,7 @@ function DiffFileView({ file }: { file: import('../lib/diff-parser').ParsedDiffF ))}
))} -
- )} +
); } diff --git a/packages/desktop/src/styles/index.css b/packages/desktop/src/styles/index.css index 830e733b..7edd1e0b 100644 --- a/packages/desktop/src/styles/index.css +++ b/packages/desktop/src/styles/index.css @@ -3,57 +3,66 @@ /* ========== 主题变量 ========== */ :root { /* 背景层级 */ - --bg-base: #1e1e1e; - --bg-panel: #111; - --bg-sidebar: #161616; - --bg-card: #1a1a1a; - --bg-card-hover: #1c1c1c; - --bg-hover: #252525; - --bg-active: #1e1e1e; - --bg-selected: #0d2d4a; - --bg-selected-hover: #094771; - --bg-input: #252525; - --bg-tooltip: #1e1e1e; - --bg-scrollbar: #1e1e1e; - --bg-code: #1a1a1a; - --bg-code-header: #222; + --bg-base: #0d1015; + --bg-panel: #131a24; + --bg-sidebar: #0d1015; + --bg-card: #1b232e; + --bg-card-hover: #222c38; + --bg-hover: #283442; + --bg-active: #2c3948; + --bg-selected: #20384c; + --bg-selected-hover: #2a5068; + --bg-input: #18212c; + --bg-tooltip: #1d2732; + --bg-scrollbar: #121720; + --bg-code: #111820; + --bg-code-header: #1b2530; + --bg-titlebar: #0d1015; + --bg-rail: #0d1015; + --bg-rail-hover: #1a222d; + --bg-rail-active: #202a35; + --bg-sidebar-hover: #1a222d; + --text-rail: #8f9baa; + --border-titlebar: #202a37; + --border-rail: #1c2632; + --border-sidebar: #293442; /* 文字层级 */ - --text-primary: #ccc; - --text-title: #ddd; - --text-secondary: #bbb; - --text-tertiary: #999; - --text-muted: #777; - --text-placeholder: #777; - --text-disabled: #666; - --text-inverse: #111; + --text-primary: #dfe7ee; + --text-title: #f4f7fa; + --text-secondary: #b9c5d0; + --text-tertiary: #91a0ae; + --text-muted: #758493; + --text-placeholder: #687787; + --text-disabled: #526170; + --text-inverse: #0b1015; --text-white: #fff; /* 边框层级 */ - --border-default: #222; - --border-card: #2a2a2a; - --border-hover: #3a3a3a; - --border-strong: #333; - --border-divider: #222; + --border-default: #222d39; + --border-card: #2d3a48; + --border-hover: #405163; + --border-strong: #4d6073; + --border-divider: #25303c; /* 功能色 */ - --accent-primary: #569cd6; - --accent-success: #4ec9b0; - --accent-warning: #e5c07b; - --accent-danger: #f44747; + --accent-primary: #e8ad5e; + --accent-success: #78d0aa; + --accent-warning: #f0c26e; + --accent-danger: #f08c86; --accent-danger-bg: #2a1515; --accent-danger-border: #5a2020; - --btn-primary-bg: #1a3a5c; - --btn-primary-hover: #1a4a6c; + --btn-primary-bg: #29485c; + --btn-primary-hover: #35637c; --btn-danger-bg: #3a1a1a; --btn-danger-hover: #4a1a1a; --btn-cancel-bg: #2a2a2a; --btn-cancel-hover: #3a3a3a; - --btn-send-bg: #fff; + --btn-send-bg: #e8ad5e; /* 滚动条 */ - --scrollbar-thumb: #555; - --scrollbar-thumb-hover: #666; + --scrollbar-thumb: #425364; + --scrollbar-thumb-hover: #53697d; /* Diff 展示 */ --diff-add-bg: #1a2f1a; @@ -88,50 +97,59 @@ /* 白色主题 */ [data-theme="light"] { - --bg-base: #fff; - --bg-panel: #f5f5f5; - --bg-sidebar: #fafafa; - --bg-card: #fff; - --bg-card-hover: #f8f8f8; - --bg-hover: #eee; - --bg-active: #e8e8e8; - --bg-selected: #e3f2fd; - --bg-selected-hover: #bbdefb; - --bg-input: #f5f5f5; + --bg-base: #f3f6f8; + --bg-panel: #ffffff; + --bg-sidebar: #f3f6f8; + --bg-card: #ffffff; + --bg-card-hover: #f5f8fa; + --bg-hover: #e6edf1; + --bg-active: #dce7ed; + --bg-selected: #dff0f7; + --bg-selected-hover: #cbe5ef; + --bg-input: #f7fafb; --bg-tooltip: #fff; --bg-scrollbar: #f5f5f5; --bg-code: #f8f8f8; --bg-code-header: #eee; - - --text-primary: #333; - --text-title: #111; - --text-secondary: #444; - --text-tertiary: #666; - --text-muted: #888; - --text-placeholder: #888; - --text-disabled: #777; + --bg-titlebar: #f3f6f8; + --bg-rail: #f3f6f8; + --bg-rail-hover: #e8edf1; + --bg-rail-active: #e0e7ec; + --bg-sidebar-hover: #e8edf1; + --text-rail: #687580; + --border-titlebar: #dbe2e8; + --border-rail: #d8e0e6; + --border-sidebar: #dce4ea; + + --text-primary: #26343f; + --text-title: #10212c; + --text-secondary: #425361; + --text-tertiary: #687b89; + --text-muted: #81919d; + --text-placeholder: #8c9ba5; + --text-disabled: #9aa8b2; --text-inverse: #fff; --text-white: #fff; - --border-default: #e0e0e0; - --border-card: #e8e8e8; - --border-hover: #d0d0d0; - --border-strong: #ccc; - --border-divider: #e0e0e0; + --border-default: #d9e2e8; + --border-card: #dce6eb; + --border-hover: #c7d5dd; + --border-strong: #b4c4ce; + --border-divider: #d9e2e8; - --accent-primary: #0066cc; - --accent-success: #2e7d32; + --accent-primary: #b56f1f; + --accent-success: #2b7d61; --accent-warning: #ed6c02; --accent-danger: #d32f2f; --accent-danger-bg: #ffebee; --accent-danger-border: #ef9a9a; - --btn-primary-bg: #e3f2fd; - --btn-primary-hover: #bbdefb; + --btn-primary-bg: #f6e5cb; + --btn-primary-hover: #efd3aa; --btn-danger-bg: #ffebee; --btn-danger-hover: #ffcdd2; --btn-cancel-bg: #f5f5f5; --btn-cancel-hover: #eee; - --btn-send-bg: #0066cc; + --btn-send-bg: #b56f1f; --scrollbar-thumb: #bbb; --scrollbar-thumb-hover: #999; @@ -183,6 +201,15 @@ --bg-scrollbar: #f0ebe3; --bg-code: #f5f0e8; --bg-code-header: #e8e3d8; + --bg-titlebar: #eee9e0; + --bg-rail: #e8e2d8; + --bg-rail-hover: #ddd7cd; + --bg-rail-active: #d5cec3; + --bg-sidebar-hover: #e9e3da; + --text-rail: #746f68; + --border-titlebar: #d9d2c8; + --border-rail: #d4cdc3; + --border-sidebar: #ddd6cb; --text-primary: #3d3b36; --text-title: #1a1917; @@ -380,6 +407,102 @@ body, accent-color: var(--accent-primary); } +/* ===== Visual polish ===== */ +button, +textarea, +input, +select { + transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease; +} + +.cc-project-strip-shell { + background: linear-gradient(180deg, var(--bg-panel), var(--bg-base)); + border-right-color: var(--border-default); +} + +.cc-project-strip-shell button { + border-radius: 9px; +} + +.cc-agent-sidebar-shell { + background: var(--bg-sidebar); + border-right-color: var(--border-default); +} + +.cc-agent-sidebar-shell > div:first-child { + padding-top: 14px; + padding-bottom: 6px; +} + +.cc-agent-sidebar-shell > div:first-child span { + color: var(--text-primary); + letter-spacing: .01em; +} + +.cc-agent-sidebar-shell button { + border-radius: 9px; +} + +.cc-agent-sidebar-shell button:hover { + transform: translateY(-1px); +} + +.cc-agent-sidebar-shell .border-t { + border-color: var(--border-default); +} + +.cc-agent-sidebar-shell .bg-\[var\(--bg-selected\)\] { + box-shadow: inset 2px 0 0 var(--accent-primary); +} + +.cc-agent-workspace-shell { + background: radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--accent-primary) 5%, transparent), transparent 34%), var(--bg-panel); +} + +.cc-agent-workspace-shell textarea { + color: var(--text-primary); +} + +.cc-agent-workspace-shell textarea::placeholder { + color: var(--text-placeholder); +} + +.cc-agent-workspace-shell .bg-\[var\(--btn-send-bg\)\] { + border-radius: 8px; + color: var(--text-inverse); +} + +.cc-agent-workspace-shell .bg-\[var\(--bg-card\)\] { + background: var(--bg-input); +} + +.cc-settings-shell { + background: var(--bg-panel); +} + +.cc-settings-shell nav { + background: var(--bg-sidebar); + border-right-color: var(--border-default); +} + +.cc-settings-shell nav button { + margin: 2px 8px; + border-radius: 8px; +} + +.cc-settings-shell nav button:hover { + background: var(--bg-hover); +} + +@media (prefers-reduced-motion: reduce) { + *, + *::before, + *::after { + transition-duration: .01ms !important; + animation-duration: .01ms !important; + } +} + /* PrismJS 深色主题覆盖 */ .markdown-body pre[class*="language-"], .markdown-body code[class*="language-"] { @@ -568,3 +691,518 @@ body, [data-theme="paper"] .markdown-body .token.important { color: #8b2d2d; } + +/* ===== Codex-inspired workspace layers ===== */ +.cc-project-strip-shell { + width: 64px; + background: var(--bg-base); + border-right: 1px solid var(--border-divider); +} + +.cc-rail-button { + width: 38px; + height: 38px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 12px; + color: var(--text-secondary); + transition: background-color 140ms ease, color 140ms ease, transform 140ms ease; +} + +.cc-rail-button:hover { + background: var(--bg-hover); + transform: translateY(-1px); +} + +.cc-rail-button:focus-visible { + outline: none; +} +.cc-rail-button-active { + color: var(--text-title); + background: var(--bg-card); + box-shadow: 0 5px 18px color-mix(in srgb, var(--bg-base) 70%, transparent); +} + +.cc-agent-sidebar-shell { + width: 296px; + background: var(--bg-sidebar); +} + +.cc-sidebar-header { + background: linear-gradient(180deg, color-mix(in srgb, var(--bg-sidebar) 96%, var(--accent-primary)), var(--bg-sidebar)); +} + +.cc-project-switcher { + border: 1px solid transparent; +} + +.cc-project-switcher:hover, +.cc-project-switcher:focus-visible { + border-color: var(--border-card); + outline: none; +} + +.cc-project-mark { + width: 26px; + height: 26px; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 8px; + color: var(--accent-primary); + background: color-mix(in srgb, var(--accent-primary) 16%, var(--bg-card)); +} + +.cc-sidebar-icon-button { + width: 32px; + height: 32px; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 9px; + color: var(--text-muted); +} + +.cc-sidebar-icon-button:hover { + color: var(--text-primary); + background: var(--bg-hover); +} + +.cc-project-menu { + backdrop-filter: blur(18px); +} + +.cc-new-chat-button { + background: var(--bg-card); + border: 1px solid var(--border-card); + box-shadow: 0 8px 18px color-mix(in srgb, var(--bg-base) 20%, transparent); +} + +.cc-new-chat-button:hover { + border-color: var(--border-hover); + background: var(--bg-card-hover); +} + +.cc-thread-row { + color: var(--text-secondary); + border: 1px solid transparent; + transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; +} + +.cc-thread-row:hover { + color: var(--text-primary); + background: var(--bg-card-hover); +} + +.cc-thread-row-active { + color: var(--text-title); + background: var(--bg-selected); + border-color: color-mix(in srgb, var(--accent-primary) 24%, var(--border-card)); + box-shadow: inset 3px 0 0 var(--accent-primary); +} + +.cc-thread-dot { + width: 6px; + height: 6px; + flex: 0 0 auto; + border-radius: 50%; + background: var(--text-disabled); + margin-right: 3px; +} + +.cc-thread-row-active .cc-thread-dot { + background: var(--accent-primary); + box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 16%, transparent); +} + +.cc-chat-surface { + margin: 0; + border: 0; + border-radius: 0; + background: transparent; + overflow: hidden; + box-shadow: none; +} + +.cc-empty-workspace { + padding: 24px; + background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--accent-primary) 9%, transparent), transparent 34%), var(--bg-panel); +} + +.cc-empty-workspace > h2 { + margin-top: -28px; + font-size: 26px; + letter-spacing: -0.03em; +} + +.cc-empty-workspace > .w-full { + max-width: 760px; +} + +.cc-chat-surface > .shrink-0:last-child, +.cc-chat-surface > .shrink-0:last-child > div { + background: var(--bg-base); +} + +.cc-chat-surface > .shrink-0:last-child { + padding: 12px 24px 20px; + background: transparent !important; + border: 0 !important; + box-shadow: none !important; +} + +.cc-input-box-shell { + width: 100%; + margin: 0; + padding: 0; + background: transparent !important; + border: 0 !important; + box-shadow: none !important; +} + +.cc-input-box-shell > .rounded-2xl { + min-height: 92px; + margin: 0; + border-radius: 18px; + background: var(--bg-input); + border-color: var(--border-card); + box-shadow: 0 12px 28px color-mix(in srgb, #000 16%, transparent); +} + +.cc-empty-workspace .cc-input-box-shell { + max-width: 760px; +} + +.cc-chat-surface .rounded-2xl.border.bg-\[var\(--bg-card\)\] { + margin: 0; + border-radius: 18px; + background: var(--bg-input); + border-color: var(--border-card); + box-shadow: 0 12px 28px color-mix(in srgb, #000 16%, transparent); +} + +.cc-message-user { + padding-right: 24px; +} + +.cc-user-bubble { + background: var(--bg-selected); + border: 1px solid color-mix(in srgb, var(--accent-primary) 20%, var(--border-card)); + box-shadow: 0 8px 18px color-mix(in srgb, #000 12%, transparent); +} + +.cc-message-assistant { + padding-left: 24px; + padding-right: 24px; +} + +.cc-turn-diff-wrap { + margin-left: 72px; + margin-right: 56px; +} + +.cc-event-row { + max-width: calc(100% - 48px); + margin-left: 24px; + padding: 7px 10px; + border: 1px solid var(--border-card); + border-radius: 10px; + background: color-mix(in srgb, var(--bg-card) 78%, transparent); +} + +.cc-reasoning-event { + border-style: dashed; + color: var(--text-muted); +} + +.cc-tool-event { + background: color-mix(in srgb, var(--bg-code) 86%, var(--bg-card)); +} + +.cc-error-event { + background: var(--accent-danger-bg); +} + +.cc-chat-surface .mt-2.rounded-lg.bg-\[var\(--bg-card\)\] { + border-radius: 12px; + border-color: var(--border-card); + background: var(--bg-code); + box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 4%, transparent); +} + +.cc-chat-surface .font-mono { + font-variant-ligatures: none; +} + +[data-theme="light"] .cc-chat-surface { + background: transparent; + box-shadow: none; +} + +[data-theme="light"] .cc-chat-surface > .shrink-0:last-child, +[data-theme="light"] .cc-chat-surface > .shrink-0:last-child > div { + background: #f4f7f9; +} + +[data-theme="light"] .cc-input-box-shell > .rounded-2xl, +[data-theme="light"] .cc-chat-surface .rounded-2xl.border.bg-\[var\(--bg-card\)\] { + background: #ffffff; + box-shadow: 0 12px 28px rgba(33, 53, 66, .12); +} + +[data-theme="light"] .cc-user-bubble { + background: #edf4f7; + border-color: #d6e4ea; +} + +.cc-tool-summary, +.cc-tool-call-card { + margin-left: 0; + margin-right: 0; +} + +.cc-tool-group { + margin: 3px 24px 7px; + border-left: 1px solid var(--border-card); +} + +.cc-tool-group-summary { + display: flex; + align-items: center; + gap: 7px; + width: 100%; + padding: 4px 8px; + color: var(--text-secondary); + font-size: 13px; + text-align: left; + border-radius: 5px; +} + +.cc-tool-group-summary:hover { + background: var(--bg-hover); + color: var(--text-primary); +} + +.cc-tool-args { + min-width: 0; + overflow: hidden; + color: var(--text-muted); + white-space: nowrap; + text-overflow: clip; + -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%); + mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%); +} + +.cc-tool-summary .cc-tool-args { + max-width: min(52vw, 440px); +} + +.cc-tool-group-count, +.cc-tool-group-muted { + color: var(--text-muted); +} + +.cc-tool-group-error { + margin-left: auto; + color: var(--accent-danger); +} + +.cc-tool-group-details { + padding: 2px 0 2px 12px; +} + +.cc-tool-group-item { + min-height: 26px; +} + +.cc-tool-group-pending { + display: flex; + align-items: center; + gap: 7px; + padding: 4px 8px; + color: var(--text-secondary); + font-size: 12px; +} + +.cc-tool-group-dot { + width: 5px; + height: 5px; + border-radius: 999px; + background: var(--accent-primary); +} + +.cc-tool-summary > button, +.cc-tool-call-card { + border-radius: 5px; +} + +.cc-tool-summary > button { + width: 100%; + justify-content: flex-start; + border: 0; + background: transparent; + color: var(--text-secondary); + padding: 4px 8px; +} + +.cc-tool-summary > button:hover { + background: var(--bg-hover); +} + +.cc-diff-block { + border-color: var(--border-card); + background: var(--bg-code); +} + +.cc-diff-block > pre > div { + padding-left: 12px; + padding-right: 12px; +} + +.cc-diff-block > pre > div:first-child { + padding-top: 5px; +} + +.cc-diff-block > pre > div:last-child { + padding-bottom: 5px; +} + +/* ===== Codex shell alignment ===== */ +.cc-titlebar { + background: var(--bg-titlebar); + color: var(--text-tertiary); +} + +.cc-app-content, +.cc-page-container { + background: var(--bg-base); +} + +.cc-project-strip-shell { + width: 56px; + background: var(--bg-rail); + border-right-color: var(--border-rail); + gap: 6px; +} + +.cc-rail-button { + width: 36px; + height: 36px; + border-radius: 10px; + color: var(--text-rail); +} + +.cc-rail-button:hover { + background: var(--bg-rail-hover); + color: var(--text-primary); + transform: none; +} + +.cc-rail-button:focus-visible { + outline: none; +} +.cc-rail-button-active { + color: var(--text-title); + background: var(--bg-rail-active); + box-shadow: none; +} + +.cc-agent-sidebar-shell, +.cc-automation-sidebar { + background: var(--bg-panel); + border-right-color: var(--border-sidebar); +} + +.cc-sidebar-header, +.cc-automation-sidebar-header { + background: var(--bg-panel); +} + +.cc-agent-workspace-shell { + background: var(--bg-panel); +} +.cc-automation-layout { + background: var(--bg-base); +} + +.cc-automation-sidebar-row { + border: 1px solid transparent; + transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; +} + +.cc-automation-sidebar-row:hover { + background: var(--bg-sidebar-hover); + border-color: var(--border-sidebar); +} + +.cc-automation-main-header { + background: var(--bg-base); +} + +.cc-automation-header-action, +.cc-automation-empty-action { + color: var(--text-inverse); + background: var(--accent-primary); +} + +.cc-automation-header-action:hover, +.cc-automation-empty-action:hover { + background: color-mix(in srgb, var(--accent-primary) 86%, #000 14%); +} + +.cc-automation-new-button { + color: var(--text-title); + background: var(--bg-card); + border: 1px solid var(--border-card); +} + +.cc-automation-new-button:hover { + background: var(--bg-card-hover); + border-color: var(--border-hover); +} + +.cc-automation-main-content { + background: var(--bg-base); +} + +.cc-automation-empty-icon { + color: var(--accent-primary); + background: color-mix(in srgb, var(--accent-primary) 12%, var(--bg-card)); + border: 1px solid color-mix(in srgb, var(--accent-primary) 24%, var(--border-card)); +} + +.cc-automation-card { + border-color: var(--border-card); + background: var(--bg-card); + box-shadow: 0 12px 30px color-mix(in srgb, #000 12%, transparent); +} + +.cc-automation-status-on { + color: var(--accent-success); + background: color-mix(in srgb, var(--accent-success) 13%, transparent); +} + +.cc-automation-status-off { + color: var(--text-muted); + background: var(--bg-base); +} + +.cc-automation-icon-button { + width: 32px; + height: 32px; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 9px; + color: var(--text-muted); +} + +.cc-automation-icon-button:hover { + color: var(--text-primary); + background: var(--bg-hover); +} + +.cc-automation-delete:hover { + color: var(--accent-danger); +}