v0.1.1: 多Agent代码质量审查+优化

- fix: useCodeMirror onChange闭包过期导致编辑器内容丢失同步(P0)
- feat: 全部组件添加displayName(React DevTools调试支持)
- feat: 全部组件添加ARIA属性(WCAG无障碍支持)
- fix: App异步操作添加try-catch错误边界
- fix: tabStore空catch块添加错误日志
- fix: sidebarStore Set→string[](Zustand可序列化)
- fix: useDragDrop readFile错误处理+空文件修复
- fix: useSettings/useTheme load()添加错误处理
- fix: useTheme toggleDarkMode引用优化
- chore: 版本号升级至0.1.1
This commit is contained in:
thzxx
2026-06-03 21:02:56 +08:00
parent d3c4062c10
commit 3cecb0f9eb
16 changed files with 106 additions and 66 deletions
+9 -4
View File
@@ -128,7 +128,7 @@ export function Sidebar() {
</button>
</div>
<div id="sidebar-tree">
<div id="sidebar-tree" role="tree" aria-label="文件树">
{/* 独立文件区 */}
{independentFiles.length > 0 && (
<div className="independent-files-section">
@@ -138,6 +138,7 @@ export function Sidebar() {
key={tab.id}
className={`tree-item independent-file-item ${tab.id === activeTabId ? 'active' : ''}`}
style={{ paddingLeft: '8px' }}
role="treeitem"
onClick={() => switchToTab(tab.id)}
>
<span className="tree-icon">
@@ -179,7 +180,7 @@ export function Sidebar() {
function FileTree({ nodes, depth, expandedDirs, toggleDir, activeTabId, activeFilePath, onFileClick }: {
nodes: FileNode[]
depth: number
expandedDirs: Set<string>
expandedDirs: string[]
toggleDir: (path: string) => void
activeTabId: string | null
activeFilePath: string | null
@@ -192,6 +193,7 @@ function FileTree({ nodes, depth, expandedDirs, toggleDir, activeTabId, activeFi
<div
className={`tree-item ${node.type === 'file' && node.path === activeFilePath ? 'active' : ''}`}
style={{ paddingLeft: (8 + depth * 16) + 'px' }}
role="treeitem"
onClick={() => {
if (node.type === 'dir') {
toggleDir(node.path)
@@ -202,7 +204,7 @@ function FileTree({ nodes, depth, expandedDirs, toggleDir, activeTabId, activeFi
>
{node.type === 'dir' ? (
<>
<span className={`tree-arrow ${expandedDirs.has(node.path) ? 'expanded' : ''}`}>
<span className={`tree-arrow ${expandedDirs.includes(node.path) ? 'expanded' : ''}`}>
<ChevronRight size={10} />
</span>
<span className="tree-icon">
@@ -219,7 +221,7 @@ function FileTree({ nodes, depth, expandedDirs, toggleDir, activeTabId, activeFi
)}
<span className="tree-name">{node.name}</span>
</div>
{node.type === 'dir' && expandedDirs.has(node.path) && node.children && (
{node.type === 'dir' && expandedDirs.includes(node.path) && node.children && (
<FileTree
nodes={node.children}
depth={depth + 1}
@@ -235,3 +237,6 @@ function FileTree({ nodes, depth, expandedDirs, toggleDir, activeTabId, activeFi
</>
)
}
Sidebar.displayName = 'Sidebar'
FileTree.displayName = 'FileTree'