From 81d3a18449df4a55bdec6052e935a2ee302ef4ae Mon Sep 17 00:00:00 2001 From: Zortos Date: Fri, 13 Mar 2026 01:22:34 +0100 Subject: [PATCH 1/2] feat: replace worktree toggle button with discoverable Select dropdown --- apps/web/src/components/BranchToolbar.tsx | 59 ++++++++++++++++++----- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/apps/web/src/components/BranchToolbar.tsx b/apps/web/src/components/BranchToolbar.tsx index b2c60b2429..4947975e9e 100644 --- a/apps/web/src/components/BranchToolbar.tsx +++ b/apps/web/src/components/BranchToolbar.tsx @@ -1,4 +1,5 @@ import type { ThreadId } from "@t3tools/contracts"; +import { FolderIcon, GitForkIcon } from "lucide-react"; import { useCallback } from "react"; import { newCommandId } from "../lib/utils"; @@ -11,7 +12,12 @@ import { resolveEffectiveEnvMode, } from "./BranchToolbar.logic"; import { BranchToolbarBranchSelector } from "./BranchToolbarBranchSelector"; -import { Button } from "./ui/button"; +import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "./ui/select"; + +const envModeItems = [ + { value: "local", label: "Local" }, + { value: "worktree", label: "New worktree" }, +] as const; interface BranchToolbarProps { threadId: ThreadId; @@ -106,19 +112,50 @@ export default function BranchToolbar({
{envLocked || activeWorktreePath ? ( - - {activeWorktreePath ? "Worktree" : "Local"} + + {activeWorktreePath ? ( + <> + + Worktree + + ) : ( + <> + + Local + + )} ) : ( -
From 51556a3cf918fa2b38cbf05f0c4b7b4b08909b36 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 12 Mar 2026 19:20:50 -0700 Subject: [PATCH 2/2] fix styles --- apps/web/src/components/BranchToolbar.tsx | 83 +++++++++++------------ apps/web/src/components/ui/select.tsx | 1 + 2 files changed, 41 insertions(+), 43 deletions(-) diff --git a/apps/web/src/components/BranchToolbar.tsx b/apps/web/src/components/BranchToolbar.tsx index 4947975e9e..e0ffa05c22 100644 --- a/apps/web/src/components/BranchToolbar.tsx +++ b/apps/web/src/components/BranchToolbar.tsx @@ -13,6 +13,7 @@ import { } from "./BranchToolbar.logic"; import { BranchToolbarBranchSelector } from "./BranchToolbarBranchSelector"; import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "./ui/select"; +import { Button } from "./ui/button"; const envModeItems = [ { value: "local", label: "Local" }, @@ -110,54 +111,50 @@ export default function BranchToolbar({ return (
-
- {envLocked || activeWorktreePath ? ( - - {activeWorktreePath ? ( - <> - - Worktree - + {envLocked || activeWorktreePath ? ( + + {activeWorktreePath ? ( + <> + + Worktree + + ) : ( + <> + + Local + + )} + + ) : ( + onEnvModeChange(value as EnvMode)} - items={envModeItems} - > - + + + - {effectiveEnvMode === "worktree" ? ( - - ) : ( - - )} - + + New worktree - - - - - - Local - - - - - - New worktree - - - - - )} -
+ + + + )}