@@ -13,6 +13,7 @@ import {
1313} from "./BranchToolbar.logic" ;
1414import { BranchToolbarBranchSelector } from "./BranchToolbarBranchSelector" ;
1515import { Select , SelectItem , SelectPopup , SelectTrigger , SelectValue } from "./ui/select" ;
16+ import { Button } from "./ui/button" ;
1617
1718const envModeItems = [
1819 { value : "local" , label : "Local" } ,
@@ -110,54 +111,50 @@ export default function BranchToolbar({
110111
111112 return (
112113 < div className = "mx-auto flex w-full max-w-3xl items-center justify-between px-5 pb-3 pt-1" >
113- < div className = "flex items-center gap-2" >
114- { envLocked || activeWorktreePath ? (
115- < span className = "inline-flex items-center gap-1.5 border border-transparent px-[calc(--spacing(2)-1px)] text-sm font-medium text-muted-foreground/70 sm:text-xs" >
116- { activeWorktreePath ? (
117- < >
118- < GitForkIcon className = "size-3" />
119- Worktree
120- </ >
114+ { envLocked || activeWorktreePath ? (
115+ < span className = "inline-flex items-center gap-1 border border-transparent px-[calc(--spacing(3)-1px)] text-sm font-medium text-muted-foreground/70 sm:text-xs" >
116+ { activeWorktreePath ? (
117+ < >
118+ < GitForkIcon className = "size-3" />
119+ Worktree
120+ </ >
121+ ) : (
122+ < >
123+ < FolderIcon className = "size-3" />
124+ Local
125+ </ >
126+ ) }
127+ </ span >
128+ ) : (
129+ < Select
130+ value = { effectiveEnvMode }
131+ onValueChange = { ( value ) => onEnvModeChange ( value as EnvMode ) }
132+ items = { envModeItems }
133+ >
134+ < SelectTrigger variant = "ghost" size = "xs" className = "font-medium" >
135+ { effectiveEnvMode === "worktree" ? (
136+ < GitForkIcon className = "size-3" />
121137 ) : (
122- < >
138+ < FolderIcon className = "size-3" />
139+ ) }
140+ < SelectValue />
141+ </ SelectTrigger >
142+ < SelectPopup >
143+ < SelectItem value = "local" >
144+ < span className = "inline-flex items-center gap-1.5" >
123145 < FolderIcon className = "size-3" />
124146 Local
125- </ >
126- ) }
127- </ span >
128- ) : (
129- < Select
130- value = { effectiveEnvMode }
131- onValueChange = { ( value ) => onEnvModeChange ( value as EnvMode ) }
132- items = { envModeItems }
133- >
134- < SelectTrigger variant = "ghost" size = "sm" >
147+ </ span >
148+ </ SelectItem >
149+ < SelectItem value = "worktree" >
135150 < span className = "inline-flex items-center gap-1.5" >
136- { effectiveEnvMode === "worktree" ? (
137- < GitForkIcon className = "size-3" />
138- ) : (
139- < FolderIcon className = "size-3" />
140- ) }
141- < SelectValue />
151+ < GitForkIcon className = "size-3" />
152+ New worktree
142153 </ span >
143- </ SelectTrigger >
144- < SelectPopup >
145- < SelectItem value = "local" >
146- < span className = "inline-flex items-center gap-1.5" >
147- < FolderIcon className = "size-3" />
148- Local
149- </ span >
150- </ SelectItem >
151- < SelectItem value = "worktree" >
152- < span className = "inline-flex items-center gap-1.5" >
153- < GitForkIcon className = "size-3" />
154- New worktree
155- </ span >
156- </ SelectItem >
157- </ SelectPopup >
158- </ Select >
159- ) }
160- </ div >
154+ </ SelectItem >
155+ </ SelectPopup >
156+ </ Select >
157+ ) }
161158
162159 < BranchToolbarBranchSelector
163160 activeProjectCwd = { activeProject . cwd }
0 commit comments