| ... | @@ -5,7 +5,6 @@ import { | ... | @@ -5,7 +5,6 @@ import { |
| 5 | FolderGit2Icon, | 5 | FolderGit2Icon, |
| 6 | FolderGitIcon, | 6 | FolderGitIcon, |
| 7 | FolderIcon, | 7 | FolderIcon, |
| 8 | HistoryIcon, | | |
| 9 | ScaleIcon, | 8 | ScaleIcon, |
| 10 | } from "lucide-react"; | 9 | } from "lucide-react"; |
| 11 | import { | 10 | import { |
| ... | @@ -41,6 +40,7 @@ import { | ... | @@ -41,6 +40,7 @@ import { |
| 41 | } from "./BranchToolbarBranchSelector"; | 40 | } from "./BranchToolbarBranchSelector"; |
| 42 | import { BranchToolbarEnvironmentSelector } from "./BranchToolbarEnvironmentSelector"; | 41 | import { BranchToolbarEnvironmentSelector } from "./BranchToolbarEnvironmentSelector"; |
| 43 | import { BranchToolbarEnvModeSelector } from "./BranchToolbarEnvModeSelector"; | 42 | import { BranchToolbarEnvModeSelector } from "./BranchToolbarEnvModeSelector"; |
| | 43 | import { PreviousWorktreeItemContent } from "./PreviousWorktreeItemContent"; |
| 44 | import { ComposerControl } from "./chat/ComposerControl"; | 44 | import { ComposerControl } from "./chat/ComposerControl"; |
| 45 | import { | 45 | import { |
| 46 | Menu, | 46 | Menu, |
| ... | @@ -105,6 +105,7 @@ interface MobileRunContextSelectorProps { | ... | @@ -105,6 +105,7 @@ interface MobileRunContextSelectorProps { |
| 105 | activeWorktreePath: string | null; | 105 | activeWorktreePath: string | null; |
| 106 | onEnvModeChange: (mode: EnvMode) => void; | 106 | onEnvModeChange: (mode: EnvMode) => void; |
| 107 | previousWorktreeLabel: string | null; | 107 | previousWorktreeLabel: string | null; |
| | 108 | previousWorktreeBranch: string | null; |
| 108 | onUsePreviousWorktree: () => void; | 109 | onUsePreviousWorktree: () => void; |
| 109 | } | 110 | } |
| 110 | | 111 | |
| ... | @@ -123,6 +124,7 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({ | ... | @@ -123,6 +124,7 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({ |
| 123 | activeWorktreePath, | 124 | activeWorktreePath, |
| 124 | onEnvModeChange, | 125 | onEnvModeChange, |
| 125 | previousWorktreeLabel, | 126 | previousWorktreeLabel, |
| | 127 | previousWorktreeBranch, |
| 126 | onUsePreviousWorktree, | 128 | onUsePreviousWorktree, |
| 127 | }: MobileRunContextSelectorProps) { | 129 | }: MobileRunContextSelectorProps) { |
| 128 | const composerFloatingLayerProps = useComposerMenuProps(); | 130 | const composerFloatingLayerProps = useComposerMenuProps(); |
| ... | @@ -217,7 +219,12 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({ | ... | @@ -217,7 +219,12 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({ |
| 217 | {triggerContent} | 219 | {triggerContent} |
| 218 | <ChevronDownIcon className="size-3 shrink-0 opacity-50" /> | 220 | <ChevronDownIcon className="size-3 shrink-0 opacity-50" /> |
| 219 | </MenuTrigger> | 221 | </MenuTrigger> |
| 220 | <MenuPopup align="start" side="top" {...composerFloatingLayerProps}> | 222 | <MenuPopup |
| | 223 | align="start" |
| | 224 | side="top" |
| | 225 | className={previousWorktreeLabel ? "w-[min(21rem,calc(100vw-2rem))]" : undefined} |
| | 226 | {...composerFloatingLayerProps} |
| | 227 | > |
| 221 | {showEnvironmentPicker && availableEnvironments && onEnvironmentChange ? ( | 228 | {showEnvironmentPicker && availableEnvironments && onEnvironmentChange ? ( |
| 222 | <> | 229 | <> |
| 223 | <MenuGroup> | 230 | <MenuGroup> |
| ... | @@ -295,10 +302,7 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({ | ... | @@ -295,10 +302,7 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({ |
| 295 | </MenuRadioItem> | 302 | </MenuRadioItem> |
| 296 | {previousWorktreeLabel ? ( | 303 | {previousWorktreeLabel ? ( |
| 297 | <MenuRadioItem disabled={envModeLocked} value="previous-worktree" closeOnClick> | 304 | <MenuRadioItem disabled={envModeLocked} value="previous-worktree" closeOnClick> |
| 298 | <span className="flex min-w-0 items-center gap-1.5"> | 305 | <PreviousWorktreeItemContent branch={previousWorktreeBranch} /> |
| 299 | <HistoryIcon className="size-3" /> | | |
| 300 | <MiddleTruncate value={previousWorktreeLabel} /> | | |
| 301 | </span> | | |
| 302 | </MenuRadioItem> | 306 | </MenuRadioItem> |
| 303 | ) : null} | 307 | ) : null} |
| 304 | </MenuRadioGroup> | 308 | </MenuRadioGroup> |
| ... | @@ -630,6 +634,7 @@ export const BranchToolbar = memo(function BranchToolbar({ | ... | @@ -630,6 +634,7 @@ export const BranchToolbar = memo(function BranchToolbar({ |
| 630 | activeWorktreePath={activeWorktreePath} | 634 | activeWorktreePath={activeWorktreePath} |
| 631 | onEnvModeChange={onEnvModeChange} | 635 | onEnvModeChange={onEnvModeChange} |
| 632 | previousWorktreeLabel={previousWorktreeLabel} | 636 | previousWorktreeLabel={previousWorktreeLabel} |
| | 637 | previousWorktreeBranch={previousWorktreeSeed?.branch ?? null} |
| 633 | onUsePreviousWorktree={onUsePreviousWorktree} | 638 | onUsePreviousWorktree={onUsePreviousWorktree} |
| 634 | /> | 639 | /> |
| 635 | </div> | 640 | </div> |
| ... | @@ -669,6 +674,7 @@ export const BranchToolbar = memo(function BranchToolbar({ | ... | @@ -669,6 +674,7 @@ export const BranchToolbar = memo(function BranchToolbar({ |
| 669 | activeWorktreePath={activeWorktreePath} | 674 | activeWorktreePath={activeWorktreePath} |
| 670 | onEnvModeChange={onEnvModeChange} | 675 | onEnvModeChange={onEnvModeChange} |
| 671 | previousWorktreeLabel={previousWorktreeLabel} | 676 | previousWorktreeLabel={previousWorktreeLabel} |
| | 677 | previousWorktreeBranch={previousWorktreeSeed?.branch ?? null} |
| 672 | onUsePreviousWorktree={onUsePreviousWorktree} | 678 | onUsePreviousWorktree={onUsePreviousWorktree} |
| 673 | /> | 679 | /> |
| 674 | ) : null} | 680 | ) : null} |