Skip to content

feat: redesign git sidebar to 2-column layout#47

Open
mai1015 wants to merge 1 commit into
duxweb:mainfrom
mai1015:feat/git-2-column-view
Open

feat: redesign git sidebar to 2-column layout#47
mai1015 wants to merge 1 commit into
duxweb:mainfrom
mai1015:feat/git-2-column-view

Conversation

@mai1015

@mai1015 mai1015 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Redesigns the git sidebar from a confusing 3-column layout to a clearer 2-column layout.

The original 3-column view mixed origin, removed lines, and modified results in a way that was hard to read. This PR changes it to:

  • Left column: removed lines
  • Right column: added lines

Also adds a configurable git view layout preference in settings.

Closes #42

Changes

  • Redesign sidebars/git.rs to render a 2-column diff layout
  • Add git_view setting module with layout preference
  • Wire setting through runtime defaults, sanitize, and summary
  • Update i18n locale strings for new settings
  • Update codux-git diff/types/wire to support the new layout

Test plan

  • Open git sidebar — verify 2-column diff renders correctly
  • Toggle the git view layout setting — verify it persists
  • Verify removed/added lines display in correct columns

Replace the confusing 3-column diff view with a clearer 2-column
layout showing removed lines on the left and added lines on the right.
Adds a configurable git view layout preference.

Closes duxweb#42

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@dux-web

dux-web commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

感谢这个 PR!两栏审查视图的方向我们认可(正是 #42 想要的),但有几个设计问题需要调整后才能合入,麻烦按下面意见修改并 rebase:

必须调整:

  1. flatChangedFiles 不要在协议上重复传一份完整文件列表——协议层只传数据、不传视图形态。建议只传扁平列表(它是事实源),树形折叠(目录 marker/懒展开)移到客户端做;或者至少复用现有 changedFiles 在客户端还原扁平视图。现在的写法让 git status 载荷直接翻倍,远程/移动端同步都受影响。
  2. 不要顺手反转未跟踪目录的语义(不递归 → 逐文件列出):那是刻意的性能决策,连原测试断言都是反着写的。如果扁平模式确实需要展开,请把它做成扁平模式内部的按需展开,而不是改全局 status 行为。
  3. 删除 GitReviewContentSummary.index_content 属于协议破坏性变更,涉及移动端兼容(协议 v3.2),需要单独讨论,不要混在 UI 重构里。
  4. .gitignore 里的 /.omo//.cursor/ 是你本地工具的目录,请从 PR 移除(放到你自己的 .git/info/exclude)。

另外: main 最近把 sidebars/git.rs 和 settings 面板拆成了模块目录,直接 rebase 冲突会比较大,建议基于最新 main 重新拆分改动。base 分支 diff 从 tree→tree 改为 tree→workdir 这点我们觉得是对的,可以保留。

改完我们优先 review。PR #48 的渲染修复已经以你的署名 cherry-pick 进 main 了,谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

git 为什么是三个栏?

2 participants