From 600d631516e31d51f07609079a4f209b60a47973 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Tue, 2 Jun 2026 01:40:16 -0700 Subject: [PATCH] Align workspace section header indentation (#4469) --- .../src/components/sidebar/worktree-list-indentation.test.ts | 4 ++-- .../src/components/sidebar/worktree-list-indentation.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/components/sidebar/worktree-list-indentation.test.ts b/src/renderer/src/components/sidebar/worktree-list-indentation.test.ts index 2f235de07..ae5113ff6 100644 --- a/src/renderer/src/components/sidebar/worktree-list-indentation.test.ts +++ b/src/renderer/src/components/sidebar/worktree-list-indentation.test.ts @@ -31,7 +31,7 @@ describe('worktree list indentation', () => { expect(getProjectGroupHeaderPaddingLeft(100)).toBe(70) }) - it('keeps flat section headers closer to the sidebar edge than project headers', () => { - expect(WORKTREE_SECTION_HEADER_PADDING_LEFT).toBeLessThan(getProjectGroupHeaderPaddingLeft(0)) + it('aligns flat section headers with top-level project headers', () => { + expect(WORKTREE_SECTION_HEADER_PADDING_LEFT).toBe(getProjectGroupHeaderPaddingLeft(0)) }) }) diff --git a/src/renderer/src/components/sidebar/worktree-list-indentation.ts b/src/renderer/src/components/sidebar/worktree-list-indentation.ts index 87d60c81f..bca9f2578 100644 --- a/src/renderer/src/components/sidebar/worktree-list-indentation.ts +++ b/src/renderer/src/components/sidebar/worktree-list-indentation.ts @@ -1,6 +1,8 @@ export const SIDEBAR_TREE_INDENT = 18 -export const WORKTREE_SECTION_HEADER_PADDING_LEFT = 6 export const PROJECT_GROUP_HEADER_BASE_PADDING = 10 +// Why: workspace/status headers and project headers occupy the same sidebar +// row role, so their titles should not shift when switching grouping modes. +export const WORKTREE_SECTION_HEADER_PADDING_LEFT = PROJECT_GROUP_HEADER_BASE_PADDING export const PROJECT_GROUP_HEADER_INDENT = 10 export const MAX_PROJECT_GROUP_HEADER_DEPTH = 6