feat: 优化代码变更面板样式和交互

- 优化变更面板和 diff 视图样式
   - 新增全部采纳和全部拒绝按钮
   - 修复删除文件的变更追踪和采纳逻辑
   - 整个标题栏可点击展开/收起
   - 增强视觉效果和用户体验
This commit is contained in:
Roe-xin
2026-03-02 10:37:45 +08:00
parent 4c7ec65577
commit 5f88c7ceac
4 changed files with 201 additions and 43 deletions

View File

@ -143,7 +143,16 @@ class ChangeTrackerService {
}
const absolutePath = path.join(workspaceFolder.uri.fsPath, change.filePath);
await fs.promises.writeFile(absolutePath, change.newContent, 'utf-8');
// 如果是删除操作,删除文件
if (change.changeType === 'delete') {
if (fs.existsSync(absolutePath)) {
await fs.promises.unlink(absolutePath);
}
} else {
// 创建或修改文件
await fs.promises.writeFile(absolutePath, change.newContent, 'utf-8');
}
this.removeChange(changeId);
return true;