feat(ui): 优化项目树左侧栏视觉样式#4589
Conversation
- 图标栈:折叠箭头与文件夹图标同一位置互斥切换(hover 显示箭头) - 文件夹图标:展开时用 FolderOpen,折叠时用 Folder - 项目名称:有/无子节点分层次弱化(fg-dim 混合 / fg-faint) - 二级菜单:整行宽、无选中文字变化、时间展示缩小 - 间距:展开的项目与下一项之间增加 6px 间距 - 悬停:一级菜单弱背景 60%,二级菜单正常强度 - 动画:移除了 children grid-template-rows 过渡避免抖动 - 操作图标:置顶/归档按钮无背景无边框 - 右侧位移动画移除
- 菜单右侧操作图标默认隐藏,悬停显示 - 新建会话图标改为 + 号 - 二级菜单固定高度,有无时间信息一致 - 时间筛选器和搜索栏固定不滚动 - 展开间距精确匹配有子节点的项目
2026-06-16.16.15.00.mov |
|
可以可以,这个简洁清晰 |
SivanCola
left a comment
There was a problem hiding this comment.
Thanks, this is directionally right and the visual cleanup is nicely scoped. Before merging, please address:
desktop/frontend/src/styles.css:.project-tree__folder-action-slotis hidden withopacity: 0andpointer-events: none, but it only becomes visible on.project-tree__folder:hover. The menu/create buttons remain tabbable, so keyboard users can focus invisible controls. Please also reveal the slot on:focus-withinor while the menu/create action is active/open.desktop/frontend/src/styles.css: the expanded-project spacing adds bothmargin-bottom: 6pxon the expanded wrapper andmargin-top: 6pxon the following wrapper. Since these wrappers are flex items, the margins do not collapse, so the intended 6px gap becomes 12px. Please keep the spacing on only one side.
I checked the PR against the current main-v2 head. The diff is UI-only, with no cache/provider-prefix risk and no security-sensitive surface. git diff --check passed, pnpm --dir desktop/frontend check:css passed, and GitHub CI is green.
Once these are addressed and CI stays green, I will consider merging it into main-v2.
- 添加 :focus-within 状态显示文件夹操作图标,键盘用户可访问 - 移除 margin-top 重复规则,间距统一由 margin-bottom 控制
SivanCola
left a comment
There was a problem hiding this comment.
Thanks for the follow-up. The two earlier review items are addressed now:
.project-tree__folder-action-slotis revealed on:focus-within, so keyboard focus no longer lands on invisible folder action buttons.- The expanded-project spacing is now one-sided (
margin-bottom: 6pxonly), so the 6px gap no longer doubles.
One regression still needs fixing before merge:
desktop/frontend/src/components/ProjectTree.tsx: the folder button now callstoggleExpand(key)unconditionally and setsaria-expandedfromisExpandedalone. For a project with no children, clicking the row can put a non-collapsible item into an expanded state, switch the icon toFolderOpen, and exposearia-expanded="true"even though no child list is rendered. Please keep the new icon stack, but gate the expand toggle,aria-expanded, and open-folder state onhasChildrenso empty projects remain non-expandable.
I also checked the broader risk surface: this PR is UI-only, with no cache/provider-prefix risk and no security-sensitive behavior. #4567 is related UI work and may need merge-order attention, but it does not change this ProjectTree.tsx expand logic.
Verified:
git diff --check origin/main-v2...HEADpassedpnpm --dir desktop/frontend check:csspassedwails generate modulefollowed bypnpm --dir desktop/frontend buildpassed- GitHub CI is green on the latest head
Once the empty-project expand behavior is fixed and CI stays green, I will consider merging it into main-v2.
Keep folder disclosure semantics gated on child presence so empty projects do not toggle expansion, expose aria-expanded, or show an open-folder state. Add focused runtime coverage for expandable and non-expandable project folder states. Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>
SivanCola
left a comment
There was a problem hiding this comment.
Approved. I pushed 85fcffd to this PR branch to address the remaining empty-project disclosure regression.
What changed:
- Kept the new project-tree icon stack, but now gates the expand toggle,
aria-expanded, and open-folder state onhasChildren. - Scoped the hover chevron CSS to expandable icon stacks so empty projects keep their folder icon on hover instead of looking like disclosure rows.
- Added focused runtime coverage for expandable and non-expandable project folder states.
Authorship note: @ttmouse remains the primary author of this PR. @SivanCola contributed as a collaborator by fixing the follow-up issue found during review and verifying the final state.
Verified:
pnpm --dir desktop/frontend exec tsx src/__tests__/project-tree-runtime.test.tspassedpnpm --dir desktop/frontend check:csspassedgit diff --check origin/main-v2...HEADpassedwails generate modulefollowed bypnpm --dir desktop/frontend buildpassed- GitHub CI passed on
85fcffd
Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 323715a133
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


改动内容
优化了左侧项目树导航栏的视觉样式
功能变更
视觉调整
问题修复
文件变更
desktop/frontend/src/components/ProjectTree.tsx— 结构优化,header 移出列表desktop/frontend/src/styles.css— 新增 200+ 行视觉样式规则