Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): sidebar follows a worktree thread's live branch #8126

Closedsethwebster(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/8126/headopened View on GitHub

Showing 3 changed files with 91 additions and 4 deletions.

x
0 of 3 viewed, 3 left
55 additions and 0 deletionsapps/web/src/components/Sidebar.logic.test.tsModified
View file
@@ -19,6 +19,7 @@
orderItemsByPreferredIds,
resolveProjectStatusIndicator,
resolveSidebarStageBadgeLabel,
+ resolveSidebarThreadBranchLabel,
resolveThreadRowClassName,
resolveSidebarThreadStatus,
resolveThreadStatusPill,
@@ -693,6 +694,60 @@
});
});
​
+describe("resolveSidebarThreadBranchLabel", () => {
+ it("follows the worktree's live ref when the agent switched branches inside it", () => {
+ expect(
+ resolveSidebarThreadBranchLabel({
+ worktreePath: "/tmp/wt/thread-1",
+ threadBranch: "seth/original",
+ currentGitBranch: "seth/switched",
+ }),
+ ).toBe("seth/switched");
+ });
+​
+ it("keeps the stamped branch for a worktree in detached HEAD", () => {
+ expect(
+ resolveSidebarThreadBranchLabel({
+ worktreePath: "/tmp/wt/thread-1",
+ threadBranch: "seth/original",
+ currentGitBranch: null,