Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): new worktree threads no longer reset their workspace on launch #15701

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

Showing 3 changed files with 81 additions and 18 deletions.

x
0 of 3 viewed, 3 left
39 additions and 0 deletionsapps/web/src/components/BranchToolbar.logic.test.tsModified
View file
@@ -17,6 +17,7 @@
resolveLocalCheckoutBranchMismatch,
resolvePreviousWorktreeLabel,
resolvePreviousWorktreeSeed,
+ resolveWorktreeBaseBranchDefault,
sanitizeNewRefName,
shouldIncludeBranchPickerItem,
shouldShowComposerContextStrip,
@@ -143,6 +144,44 @@
});
});
​
+describe("resolveWorktreeBaseBranchDefault", () => {
+ it("preselects the base branch for a new-worktree draft", () => {
+ expect(
+ resolveWorktreeBaseBranchDefault({
+ hasServerThread: false,
+ effectiveEnvMode: "worktree",
+ activeWorktreePath: null,
+ activeThreadBranch: null,
+ baseBranchCandidate: "main",
+ }),
+ ).toBe("main");
+ });
+​
+ it("leaves a launched thread to the server while its worktree is prepared", () => {
+ expect(
+ resolveWorktreeBaseBranchDefault({
+ hasServerThread: true,