| ... | @@ -4,7 +4,7 @@ import { | ... | @@ -4,7 +4,7 @@ import { |
| 4 | scopeThreadRef, | 4 | scopeThreadRef, |
| 5 | } from "@t3tools/client-runtime/environment"; | 5 | } from "@t3tools/client-runtime/environment"; |
| 6 | import type { VcsStatusResult } from "@t3tools/contracts"; | 6 | import type { VcsStatusResult } from "@t3tools/contracts"; |
| 7 | import { CloudIcon, GitPullRequestIcon, TerminalIcon } from "lucide-react"; | 7 | import { CloudIcon, FolderGit2Icon, GitPullRequestIcon, TerminalIcon } from "lucide-react"; |
| 8 | import { useMemo } from "react"; | 8 | import { useMemo } from "react"; |
| 9 | import { useEnvironment, usePrimaryEnvironmentId } from "../state/environments"; | 9 | import { useEnvironment, usePrimaryEnvironmentId } from "../state/environments"; |
| 10 | import { useProject } from "../state/entities"; | 10 | import { useProject } from "../state/entities"; |
| ... | @@ -15,6 +15,7 @@ import { useUiStateStore } from "../uiStateStore"; | ... | @@ -15,6 +15,7 @@ import { useUiStateStore } from "../uiStateStore"; |
| 15 | import { resolveChangeRequestPresentation } from "../sourceControlPresentation"; | 15 | import { resolveChangeRequestPresentation } from "../sourceControlPresentation"; |
| 16 | import { resolveThreadStatusPill, type ThreadStatusPill } from "./Sidebar.logic"; | 16 | import { resolveThreadStatusPill, type ThreadStatusPill } from "./Sidebar.logic"; |
| 17 | import type { SidebarThreadSummary } from "../types"; | 17 | import type { SidebarThreadSummary } from "../types"; |
| | 18 | import { formatWorktreePathForDisplay } from "../worktreeCleanup"; |
| 18 | import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; | 19 | import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; |
| 19 | | 20 | |
| 20 | export interface PrStatusIndicator { | 21 | export interface PrStatusIndicator { |
| ... | @@ -94,6 +95,40 @@ export function terminalStatusFromRunningIds( | ... | @@ -94,6 +95,40 @@ export function terminalStatusFromRunningIds( |
| 94 | }; | 95 | }; |
| 95 | } | 96 | } |
| 96 | | 97 | |
| | 98 | export function ThreadWorktreeIndicator({ |
| | 99 | thread, |
| | 100 | }: { |
| | 101 | thread: Pick<SidebarThreadSummary, "id" | "branch" | "worktreePath">; |
| | 102 | }) { |
| | 103 | const worktreePath = thread.worktreePath?.trim(); |
| | 104 | if (!worktreePath) { |
| | 105 | return null; |
| | 106 | } |
| | 107 | |
| | 108 | const displayPath = formatWorktreePathForDisplay(worktreePath); |
| | 109 | const tooltip = thread.branch |
| | 110 | ? `Worktree: ${displayPath} (${thread.branch})` |
| | 111 | : `Worktree: ${displayPath}`; |
| | 112 | |
| | 113 | return ( |
| | 114 | <Tooltip> |
| | 115 | <TooltipTrigger |
| | 116 | render={ |
| | 117 | <span |
| | 118 | role="img" |
| | 119 | aria-label={tooltip} |
| | 120 | data-testid={`thread-worktree-${thread.id}`} |
| | 121 | className="inline-flex items-center justify-center" |
| | 122 | /> |
| | 123 | } |
| | 124 | > |
| | 125 | <FolderGit2Icon className="size-3 text-muted-foreground/40" /> |
| | 126 | </TooltipTrigger> |
| | 127 | <TooltipPopup side="top">{tooltip}</TooltipPopup> |
| | 128 | </Tooltip> |
| | 129 | ); |
| | 130 | } |
| | 131 | |
| 97 | export function ThreadStatusLabel({ | 132 | export function ThreadStatusLabel({ |
| 98 | status, | 133 | status, |
| 99 | compact = false, | 134 | compact = false, |