From cd6bf563423e94a36a3eb69d66b90ecd5f4ddd0e Mon Sep 17 00:00:00 2001
From: phantom5099 <1011668688@qq.com>
Date: Sat, 21 Nov 2026 23:41:30 +0800
Subject: [PATCH] feat(desktop): refine coding agent workspace UI
---
packages/desktop/electron/main.ts | 13 +-
packages/desktop/src/App.tsx | 26 +-
packages/desktop/src/TitleBar.tsx | 4 +-
packages/desktop/src/agent/AgentSidebar.tsx | 199 ++---
packages/desktop/src/agent/AgentWorkspace.tsx | 10 +-
.../desktop/src/agent/AutomationPanel.tsx | 232 ++----
packages/desktop/src/agent/MessageStream.tsx | 122 +--
packages/desktop/src/agent/ProjectStrip.tsx | 253 +-----
.../src/settings/GlobalSettingsPage.tsx | 16 +-
.../src/settings/ProjectSettingsPage.tsx | 19 +-
packages/desktop/src/shared/DiffBlock.tsx | 2 +-
packages/desktop/src/shared/MessageItem.tsx | 18 +-
packages/desktop/src/shared/ToolCallCard.tsx | 2 +-
packages/desktop/src/shared/ToolCallGroup.tsx | 68 ++
packages/desktop/src/shared/ToolSummary.tsx | 43 +-
.../desktop/src/shared/UnifiedDiffView.tsx | 24 +-
packages/desktop/src/styles/index.css | 766 ++++++++++++++++--
17 files changed, 1126 insertions(+), 691 deletions(-)
create mode 100644 packages/desktop/src/shared/ToolCallGroup.tsx
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 =