Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ master 分支或截图颜色,否则"是否与 IDEA 一致"无法被验证或
`36415d346b3d18a6ded90d05afb8e0a0bface9d6`(`GraphLayoutBuilder`、
`GraphElementComparatorByLayoutIndex`、`PrintElementGeneratorImpl`、
`DottedFilterEdgesGenerator`、`GraphColorManagerImpl` 等)。算法落在
`LitheGitModule`,AppKit/SwiftUI 负责绘制与交互;Rust `git.historyPage`
Rust Core 的 `git.graphProjection`,AppKit/SwiftUI 负责绘制与交互;Rust `git.historyPage`
([`rust/lithe-core/src/git/history.rs`](../../../../rust/lithe-core/src/git/history.rs))
新增向后兼容的可选 `order` 参数,由 macOS
新增向后兼容的可选 `order` 参数;macOS
([`RustGitOperations.swift`](../../../../macos/Sources/Lithe/Core/Rust/RustGitOperations.swift))
显式请求 `order: "date"`;Windows 代码与未提供该参数时的默认行为
(`--topo-order`)不变。
和 Windows 均显式请求 `order: "date"`,未提供该参数时默认仍为 `--topo-order`。

关键规则:

Expand Down Expand Up @@ -579,7 +578,7 @@ Lithe 在工作台视图中持有 `WorkbenchToolContentStore`,本次用于 Git
- `git diff --check`

上游对照 fixture 固定保存在
[`macos/Tests/LitheGitModuleTests/Fixtures/GitGraphIDEA/`](../../../../macos/Tests/LitheGitModuleTests/Fixtures/GitGraphIDEA/)
[`shared/fixtures/git/graph-idea/`](../../../../shared/fixtures/git/graph-idea/)
(4 个布局 fixture 比较完整 layout index 向量,5 个打印 fixture 比较
节点列、半边端点、箭头与实/虚线,只排除颜色值);真实历史回归数据
冻结在
Expand All @@ -594,9 +593,7 @@ Lithe 在工作台视图中持有 `WorkbenchToolContentStore`,本次用于 Git

## 适用范围

- `macos/Sources/LitheGitModule/Services/GitGraphHeadOrdering.swift`
- `macos/Sources/LitheGitModule/Services/GitGraphProjection.swift`
- `macos/Sources/LitheGitModule/Services/GitGraphMissingParents.swift`
- `rust/lithe-core/src/git/graph.rs`
- `macos/Sources/LitheGitModule/Services/GitGraphLayoutService.swift`
- `macos/Sources/Lithe/Views/Git/GitGraphColor.swift`
- `macos/Sources/Lithe/Views/Git/GitGraphGeometry.swift`
Expand All @@ -615,7 +612,7 @@ Lithe 在工作台视图中持有 `WorkbenchToolContentStore`,本次用于 Git
- `macos/Tests/LitheTests/GitCommitFileTreeLayoutTests.swift`
- `rust/lithe-core/src/git/history.rs`
- `macos/Sources/Lithe/Core/Rust/RustGitOperations.swift`
- `macos/Tests/LitheGitModuleTests/Fixtures/GitGraphIDEA/`
- `shared/fixtures/git/graph-idea/`
- `macos/Tests/LitheTests/Fixtures/GitGraph/`
- `macos/Resources/GitGraph/`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

macOS 和 Windows 的 Git 提交图现在使用同一套 IntelliJ 风格的永久图规则:先按引用优先级确定图头,再为每个图头分配稳定的图片段和颜色,最后根据提交顺序投影到屏幕泳道。这样本地分支新增提交时,不会因为沿用父分支的第一条泳道而和父分支混成同一种颜色;两个端的分支优先级、颜色身份和合并拓扑也保持一致。

Windows 使用 SVG 绘制,图头排序、永久布局、紧凑长边及普通节点尺寸与 macOS 的 IntelliJ 基准一致。颜色使用完整有符号身份生成明暗主题 RGB,普通节点为实心,HEAD 使用外圈和中心实点;连线为直线,尺寸按字号和显示器缩放调整。今后修改提交图时,必须同时以 macOS 的实现和 IntelliJ 固定基准为准,不要重新引入泳道着色或六色取模。
Windows 使用 SVG 绘制,图头排序、永久布局、紧凑长边及普通节点尺寸与 macOS 的 IntelliJ 基准一致。颜色使用完整有符号身份生成明暗主题 RGB,普通节点为实心,HEAD 使用外圈和中心实点;连线为直线,尺寸按字号和显示器缩放调整。今后修改提交图时,必须以 Rust Core 的共享实现和 IntelliJ 固定基准为准,不要重新引入泳道着色或六色取模。

Windows 的日志筛选也基于完整已加载历史生成可见图。隐藏中间提交后,用虚线连接仍可见的祖先,而不是直接删除已绘制的行;清空筛选恢复原图。

Expand All @@ -31,9 +31,8 @@ macOS 已经按 IntelliJ 的永久图规则处理了这个问题,但 Windows

### 筛选后的祖先连接

筛选先保留完整已加载历史的永久布局,再计算哪些提交可见。Windows
`git-graph-filter-projection.ts` 移植 macOS `GitGraphProjection.dottedEdges`
的双向最近可见节点遍历规则,算法来源仍是上文关联 Note 固定的 Community
筛选先保留完整已加载历史的永久布局,再计算哪些提交可见。Rust Core 的
`git.graphProjection` 使用双向最近可见节点遍历规则,算法来源仍是上文关联 Note 固定的 Community
`36415d346b3d18a6ded90d05afb8e0a0bface9d6` 的 `DottedFilterEdgesGenerator`。
本次另核对本地 Community `fb72b4df43aba102479eb0502d20b03586b9c5b8`
的同名文件;不会按相邻显示行猜测父子关系,也不会在每次搜索时重新分配分支颜色。
Expand All @@ -42,7 +41,7 @@ macOS 已经按 IntelliJ 的永久图规则处理了这个问题,但 Windows
原始父哈希仍保留 Git 返回值。直接父子关系继续使用实线;两条路径到达同一
可见祖先时去重,直接关系优先。无关分支不会因为显示行相邻而连接。

未加载父提交通过 macOS `GitGraphMissingParents` 相同的隐藏边界分组规则
未加载父提交通过 Core 的隐藏边界分组规则
传播,多个合并路径共用边界组,避免给每条隐藏提交复制全部祖先哈希集合。
传播遇到可见祖先就停止,由该祖先持有后续连接;分页加载父提交后重新投影,
不再标记该父提交缺失。隐藏的已加载根提交不属于缺失历史。
Expand Down Expand Up @@ -287,14 +286,13 @@ ResizeObserver(浏览器按帧合并的尺寸观察器)服务已挂载行,

## 适用范围

- `windows/tauri/src/features/git/utils/git-graph-layout.ts`
- `rust/lithe-core/src/git/graph.rs`
- `windows/tauri/src/features/git/utils/git-graph-colors.ts`
- `windows/tauri/src/features/git/utils/git-graph-geometry.ts`
- `windows/tauri/src/features/git/hooks/use-git-graph-paint.ts`
- `windows/tauri/src/features/git/hooks/use-git-log-controller.ts`
- `windows/tauri/src/features/git/api/git-commits-api.ts`
- `windows/tauri/src/features/git/stores/git-log-preferences.store.ts`
- `windows/tauri/src/features/git/utils/git-graph-filter-projection.ts`
- `windows/tauri/src/features/git/components/log/git-commit-table.tsx`
- `windows/tauri/src/features/git/components/log/git-commit-inspector.tsx`
- `windows/tauri/src/features/git/components/log/git-log-tool-window.tsx`
Expand All @@ -304,9 +302,7 @@ ResizeObserver(浏览器按帧合并的尺寸观察器)服务已挂载行,
- `windows/tauri/src/features/git/hooks/use-git-graph-reference-metrics.ts`
- `windows/tauri/src/features/git/components/log/git-graph-row.tsx`
- `windows/tauri/src/features/git/components/log/git-graph.css`
- `macos/Sources/LitheGitModule/Services/GitGraphHeadOrdering.swift`
- `macos/Sources/LitheGitModule/Services/GitGraphProjection.swift`
- `macos/Tests/LitheGitModuleTests/Fixtures/GitGraphIDEA/`
- `shared/fixtures/git/graph-idea/`

## 后续:布局下沉到 Rust Core(#1662 GIT-18/19)

Expand Down
4 changes: 2 additions & 2 deletions scripts/logging/test-log-events.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ test('generated references use catalog channel, event identity and operation', {
test('helper production roots are gated while remote server and standalone binaries are excluded', { timeout: 5000 }, async () => {
const root = await mkdtemp(path.join(tmpdir(), 'lithe-helper-log-usage-'));
try {
const roots = ['macos/Sources', ...['core', 'agent-host', 'git-host', 'ide-host', 'remote'].map(name => `rust/lithe-${name}/src`)];
const roots = ['macos/Sources', ...['core', 'core-rules', 'agent-host', 'git-host', 'ide-host', 'remote'].map(name => `rust/lithe-${name}/src`)];
await Promise.all(roots.map(directory => mkdir(path.join(root, directory), { recursive: true })));
const included = ['agent-host', 'git-host', 'ide-host', 'remote'].map(name => `rust/lithe-${name}/src/production.rs`);
const included = ['core-rules', 'agent-host', 'git-host', 'ide-host', 'remote'].map(name => `rust/lithe-${name}/src/production.rs`);
const excluded = ['rust/lithe-remote/src/server/worker.rs', 'rust/lithe-remote/src/bin/server.rs', 'rust/lithe-ide-host/src/bin/mcp.rs'];
await Promise.all([...included, ...excluded].map(async file => {
await mkdir(path.dirname(path.join(root, file)), { recursive: true });
Expand Down
Loading