Skip to content

Commit f2b86c6

Browse files
fix(sidebar): remove worktree name chip from task items (#3626)
1 parent 97f151a commit f2b86c6

2 files changed

Lines changed: 2 additions & 54 deletions

File tree

packages/ui/src/features/sidebar/components/TaskListView.tsx

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import type {
1212
TaskGroup,
1313
} from "@posthog/core/sidebar/sidebarData.types";
1414
import { MenuLabel } from "@posthog/quill";
15-
import { getFileName } from "@posthog/shared";
1615
import { builderHog } from "@posthog/ui/assets/hedgehogs";
1716
import { useFolders } from "@posthog/ui/features/folders/useFolders";
1817
import { useSettingsStore } from "@posthog/ui/features/settings/settingsStore";
@@ -92,32 +91,10 @@ function TaskRow({
9291
depth?: number;
9392
}) {
9493
const workspace = useWorkspace(task.id);
95-
const { folders } = useFolders();
9694
const effectiveMode =
9795
workspace?.mode ??
9896
(task.taskRunEnvironment === "cloud" ? "cloud" : undefined);
9997

100-
// Chip identifying the checkout the task runs in: app-managed worktrees
101-
// (worktree mode) and local tasks whose registered folder is itself a
102-
// linked worktree of the group's main clone.
103-
const worktreeCheckout = useMemo(() => {
104-
if (workspace?.worktreePath) {
105-
return {
106-
name: workspace.worktreeName ?? getFileName(workspace.worktreePath),
107-
path: workspace.worktreePath,
108-
};
109-
}
110-
if (workspace?.mode === "local" && workspace.folderPath) {
111-
const folder = folders.find((f) => f.path === workspace.folderPath);
112-
if (folder?.mainRepoPath) {
113-
return {
114-
name: getFileName(workspace.folderPath),
115-
path: workspace.folderPath,
116-
};
117-
}
118-
}
119-
return null;
120-
}, [workspace, folders]);
12198
const { prState, hasDiff } = useTaskPrStatus(task);
12299
const isArchiving = useArchivingTasksStore((s) =>
123100
s.archivingTaskIds.has(task.id),
@@ -134,8 +111,6 @@ function TaskRow({
134111
hideHoverActions={hideHoverActions}
135112
isEditing={isEditing}
136113
workspaceMode={effectiveMode}
137-
worktreeName={worktreeCheckout?.name}
138-
worktreePath={worktreeCheckout?.path}
139114
isSuspended={task.isSuspended}
140115
isGenerating={task.isGenerating}
141116
isUnread={task.isUnread}

packages/ui/src/features/sidebar/components/items/TaskItem.tsx

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import {
2-
Archive,
3-
GitFork,
4-
GitPullRequest,
5-
PushPin,
6-
} from "@phosphor-icons/react";
1+
import { Archive, GitPullRequest, PushPin } from "@phosphor-icons/react";
72
import { parseGithubUrl } from "@posthog/git/utils";
83
import type { WorkspaceMode } from "@posthog/shared";
94
import { formatRelativeTimeShort } from "@posthog/shared";
@@ -34,17 +29,6 @@ function PrBadge({ url, number }: { url: string; number: number }) {
3429
);
3530
}
3631

37-
function WorktreeChip({ name, path }: { name: string; path?: string }) {
38-
return (
39-
<Tooltip content={path ?? name} side="top">
40-
<span className="flex h-4 max-w-[96px] shrink-0 items-center gap-0.5 rounded bg-gray-3 px-1 text-[11px] text-gray-11">
41-
<GitFork size={10} weight="bold" className="shrink-0" />
42-
<span className="truncate">{name}</span>
43-
</span>
44-
</Tooltip>
45-
);
46-
}
47-
4832
interface TaskItemProps {
4933
depth?: number;
5034
taskId: string;
@@ -55,10 +39,6 @@ interface TaskItemProps {
5539
isArchiving?: boolean;
5640
hideHoverActions?: boolean;
5741
workspaceMode?: WorkspaceMode;
58-
/** Checkout name shown as a chip when the task runs in a git worktree. */
59-
worktreeName?: string;
60-
/** Full path of that checkout, surfaced in the chip's tooltip. */
61-
worktreePath?: string;
6242
isGenerating?: boolean;
6343
isUnread?: boolean;
6444
isPinned?: boolean;
@@ -131,8 +111,6 @@ export function TaskItem({
131111
isArchiving = false,
132112
hideHoverActions = false,
133113
workspaceMode,
134-
worktreeName,
135-
worktreePath,
136114
isSuspended = false,
137115
isGenerating,
138116
isUnread,
@@ -195,14 +173,9 @@ export function TaskItem({
195173
/>
196174
) : null;
197175

198-
const worktreeChip = worktreeName ? (
199-
<WorktreeChip name={worktreeName} path={worktreePath} />
200-
) : null;
201-
202176
const endContent =
203-
worktreeChip || prBadge || timestampNode || toolbar ? (
177+
prBadge || timestampNode || toolbar ? (
204178
<>
205-
{worktreeChip}
206179
{prBadge}
207180
{timestampNode}
208181
{toolbar}

0 commit comments

Comments
 (0)