Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
ArrowUpDownIcon,
ChevronRightIcon,
CloudIcon,
FolderGit2Icon,
FolderPlusIcon,
SearchIcon,
SettingsIcon,
Expand All @@ -18,6 +19,7 @@ import {
ThreadStatusLabel,
} from "./ThreadStatusIndicators";
import { ProjectFavicon } from "./ProjectFavicon";
import { formatWorktreePathForDisplay } from "../worktreeCleanup";
import { autoAnimate } from "@formkit/auto-animate";
import React, { useCallback, useEffect, memo, useMemo, useRef, useState } from "react";
import { useShallow } from "zustand/react/shallow";
Expand Down Expand Up @@ -373,6 +375,12 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
),
);
const gitCwd = thread.worktreePath ?? threadProjectCwd ?? props.projectCwd;
const worktreePath = thread.worktreePath?.trim() ? thread.worktreePath : null;
const worktreeTooltip = worktreePath
? thread.branch
? `Worktree: ${formatWorktreePathForDisplay(worktreePath)} (${thread.branch})`
: `Worktree: ${formatWorktreePathForDisplay(worktreePath)}`
: null;
const gitStatus = useVcsStatus({
environmentId: thread.environmentId,
cwd: thread.branch != null ? gitCwd : null,
Expand Down Expand Up @@ -609,6 +617,23 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
)}
</div>
<div className="ml-auto flex shrink-0 items-center gap-1.5">
{worktreeTooltip && (
<Tooltip>
<TooltipTrigger
render={
<span
role="img"
aria-label={worktreeTooltip}
data-testid={`thread-worktree-${thread.id}`}
className="inline-flex items-center justify-center"
/>
}
>
<FolderGit2Icon className="size-3 text-muted-foreground/40" />
</TooltipTrigger>
<TooltipPopup side="top">{worktreeTooltip}</TooltipPopup>
</Tooltip>
)}
{terminalStatus && (
<Tooltip>
<TooltipTrigger
Expand Down
Loading