From d413c3d46326994d1ee070ecede1f776c7dd8d59 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Sun, 16 Aug 2026 18:34:01 -0700 Subject: [PATCH] refactor(sidebar): name the label map for what it is keyed by The map moved from worktree id to host-qualified identity in the previous commit; the parameter name still said 'ByWorktreeId', which is exactly the collapse this change exists to prevent. --- .../sidebar/worktree-list/grouping/build-rows.ts | 2 +- .../sidebar/worktree-list/grouping/group-sections.ts | 4 ++-- .../sidebar/worktree-list/grouping/row-builders.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/components/sidebar/worktree-list/grouping/build-rows.ts b/src/renderer/src/components/sidebar/worktree-list/grouping/build-rows.ts index 3abd7176929..598c1dd81b4 100644 --- a/src/renderer/src/components/sidebar/worktree-list/grouping/build-rows.ts +++ b/src/renderer/src/components/sidebar/worktree-list/grouping/build-rows.ts @@ -131,7 +131,7 @@ export function buildRows( collapsedGroups, groupDepth: 0, sectionKey: ALL_GROUP_KEY, - hostContextLabelByWorktreeId: mixedWorktreeHostContextLabels, + hostContextLabelByWorktreeIdentity: mixedWorktreeHostContextLabels, cyclicLineageIds }) } diff --git a/src/renderer/src/components/sidebar/worktree-list/grouping/group-sections.ts b/src/renderer/src/components/sidebar/worktree-list/grouping/group-sections.ts index fc3acb360c7..15bd81ace63 100644 --- a/src/renderer/src/components/sidebar/worktree-list/grouping/group-sections.ts +++ b/src/renderer/src/components/sidebar/worktree-list/grouping/group-sections.ts @@ -160,7 +160,7 @@ export function appendOrderedGroups( // be registered on two hosts — then every row in the group shares a repo id // and the per-repo label cannot tell them apart. Fall back to the per-row // host labels, which are keyed by host-qualified identity. - const hostContextLabelByWorktreeId = + const hostContextLabelByWorktreeIdentity = groupBy === 'repo' && hostContextLabelByRepoId ? undefined : mixedWorktreeHostContextLabels appendWorktreeRows(result, items, repoMap, lineageById, worktreeMap, { nestLineage, @@ -168,7 +168,7 @@ export function appendOrderedGroups( groupDepth: projectGroupDepth, sectionKey: key, hostContextLabelByRepoId, - hostContextLabelByWorktreeId, + hostContextLabelByWorktreeIdentity, cyclicLineageIds }) } diff --git a/src/renderer/src/components/sidebar/worktree-list/grouping/row-builders.ts b/src/renderer/src/components/sidebar/worktree-list/grouping/row-builders.ts index bada875fda4..710f4ae8792 100644 --- a/src/renderer/src/components/sidebar/worktree-list/grouping/row-builders.ts +++ b/src/renderer/src/components/sidebar/worktree-list/grouping/row-builders.ts @@ -174,7 +174,7 @@ export function appendWorktreeRows( groupDepth: number sectionKey: string hostContextLabelByRepoId?: ReadonlyMap - hostContextLabelByWorktreeId?: ReadonlyMap + hostContextLabelByWorktreeIdentity?: ReadonlyMap cyclicLineageIds: ReadonlySet } ): void { @@ -184,7 +184,7 @@ export function appendWorktreeRows( groupDepth, sectionKey, hostContextLabelByRepoId, - hostContextLabelByWorktreeId, + hostContextLabelByWorktreeIdentity, cyclicLineageIds } = options if (!nestLineage) { @@ -200,7 +200,7 @@ export function appendWorktreeRows( lineageChildCount: 0, lineageCollapsed: false, hostContextLabel: - hostContextLabelByWorktreeId?.get(getWorktreeHostIdentity(worktree)) ?? + hostContextLabelByWorktreeIdentity?.get(getWorktreeHostIdentity(worktree)) ?? hostContextLabelByRepoId?.get(worktree.repoId) }) ) @@ -250,7 +250,7 @@ export function appendWorktreeRows( lineageChildCount: children.length, lineageCollapsed, hostContextLabel: - hostContextLabelByWorktreeId?.get(getWorktreeHostIdentity(worktree)) ?? + hostContextLabelByWorktreeIdentity?.get(getWorktreeHostIdentity(worktree)) ?? hostContextLabelByRepoId?.get(worktree.repoId) }) )