diff --git a/apps/web/src/components/SidebarV2.tsx b/apps/web/src/components/SidebarV2.tsx
index 72bffaab1e..493234ba6b 100644
--- a/apps/web/src/components/SidebarV2.tsx
+++ b/apps/web/src/components/SidebarV2.tsx
@@ -32,6 +32,7 @@ import {
SearchIcon,
ServerIcon,
SquarePenIcon,
+ SquareStackIcon,
Trash2Icon,
Undo2Icon,
} from "lucide-react";
@@ -217,6 +218,23 @@ function WorkingDuration(props: { startedAt: string | null }) {
return {formatWorkingDurationLabel(Date.now() - startedMs)};
}
+/**
+ * A task row stands for every tab of that task, so the count is a quiet glyph
+ * badge rather than a bare number — the icon carries the meaning without color,
+ * and the row tooltip explains what the tabs do and don't share.
+ */
+function TaskTabCountBadge(props: { count: number }) {
+ return (
+
+
+ {props.count}
+
+ );
+}
+
function SidebarV2ThreadTooltip({
thread,
projectTitle,
@@ -226,11 +244,13 @@ function SidebarV2ThreadTooltip({
modelInstanceId,
modelLabel,
branchMismatch,
+ tabCount,
}: {
thread: SidebarThreadSummary;
projectTitle: string | null;
projectCwd: string | null;
environmentLabel: string | null;
+ tabCount: number;
driverKind: ProviderInstanceEntry["driverKind"] | null;
modelInstanceId: string;
modelLabel: string;
@@ -289,6 +309,15 @@ function SidebarV2ThreadTooltip({
{modelLabel}
) : null}
+ {tabCount > 1 ? (
+
+
+
+ {tabCount} tabs sharing this worktree and branch. Each tab keeps its own
+ conversation.
+
+
+ ) : null}
{thread.session?.lastError ? (
@@ -538,6 +567,7 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {
modelInstanceId={modelInstanceId}
modelLabel={modelLabel}
branchMismatch={branchMismatch}
+ tabCount={props.tabCount}
/>
);
@@ -771,14 +801,7 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {
/>
{title}
- {props.tabCount > 1 ? (
-
- {props.tabCount}
-
- ) : null}
+ {props.tabCount > 1 ? : null}
{/* The PR badge stays outside the hover-fading slot: it must
remain visible AND clickable while the row is hovered. Only
the time/jump label yields to the settle affordance. */}
@@ -956,14 +979,7 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {
{title}
- {props.tabCount > 1 ? (
-
- {props.tabCount}
-
- ) : null}
+ {props.tabCount > 1 ? : null}
{thread.branch ? (
diff --git a/apps/web/src/components/WorkspaceTaskTabs.tsx b/apps/web/src/components/WorkspaceTaskTabs.tsx
index 267d4162a4..dc6aceaa61 100644
--- a/apps/web/src/components/WorkspaceTaskTabs.tsx
+++ b/apps/web/src/components/WorkspaceTaskTabs.tsx
@@ -1,16 +1,58 @@
-import { GitForkIcon, PlusIcon, XIcon } from "lucide-react";
-import { useState } from "react";
+import { CircleDashedIcon, GitForkIcon, InfoIcon, PlusIcon, XIcon } from "lucide-react";
+import { useMemo, useState } from "react";
import { shortcutLabelForCommand } from "../keybindings";
import { useClientSettings } from "../hooks/useSettings";
import { type WorkspaceTaskTab, useWorkspaceTaskTabs } from "../hooks/useWorkspaceTaskTabs";
+import {
+ TASK_TABS_SHARED_SCOPE_EXPLANATION,
+ describeTaskTabContexts,
+ type TaskTabContextDescriptor,
+} from "../lib/taskTabContext";
import { cn } from "../lib/utils";
import { Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger } from "./ui/tooltip";
-function tabStatusClass(tab: WorkspaceTaskTab): string {
- if (tab.blocked) return "bg-amber-500";
- if (tab.working) return "animate-pulse bg-sky-500 motion-reduce:animate-none";
- return "bg-muted-foreground/35";
+function tabThreadId(tab: WorkspaceTaskTab): string {
+ return String(tab.kind === "server" ? tab.threadRef.threadId : tab.threadId);
+}
+
+/**
+ * State is carried by shape and text as well as hue: blocked tabs get a filled
+ * ring plus "Waiting on you", working tabs get a dashed spinner glyph. Colour
+ * is the accent, never the only signal.
+ */
+function TabStateGlyph(props: { tab: WorkspaceTaskTab }) {
+ const { tab } = props;
+ if (tab.blocked) {
+ return (
+
+
+
+ );
+ }
+ if (tab.working) {
+ // Duty-cycled steps() pulse from index.css, not a continuous spin: this
+ // strip can be on screen for hours on a 120Hz display.
+ return (
+
+ );
+ }
+ return null;
+}
+
+function contextChipClass(kind: TaskTabContextDescriptor["kind"], active: boolean): string {
+ if (!active) return "border-border/30 bg-background/30 text-muted-foreground/60";
+ return kind === "snapshot"
+ ? "border-border/60 bg-muted/80 text-muted-foreground/90"
+ : "border-border/45 bg-muted/60 text-muted-foreground/75";
}
export function WorkspaceTaskTabs() {
@@ -18,11 +60,31 @@ export function WorkspaceTaskTabs() {
const { tabs, keybindings, hasTask, canForkContext, createTab, closeTab, navigateToTab } =
useWorkspaceTaskTabs();
const [creatingMode, setCreatingMode] = useState<"fresh" | "portable" | null>(null);
+ const contexts = useMemo(
+ () =>
+ describeTaskTabContexts(
+ tabs.map((tab) => ({
+ kind: tab.kind,
+ threadId: tabThreadId(tab),
+ title: tab.title,
+ position: tab.position,
+ forkProvenance: tab.forkProvenance
+ ? {
+ mode: tab.forkProvenance.mode,
+ sourceThreadId:
+ tab.forkProvenance.sourceThreadId === null
+ ? null
+ : String(tab.forkProvenance.sourceThreadId),
+ }
+ : null,
+ })),
+ ),
+ [tabs],
+ );
if (!sidebarV2Enabled || !hasTask) return null;
const newTabShortcut = shortcutLabelForCommand(keybindings, "chat.newTab");
- const workingCount = tabs.filter((tab) => tab.working).length;
const create = (mode: "fresh" | "portable") => {
if (creatingMode !== null) return;
setCreatingMode(mode);
@@ -34,66 +96,86 @@ export function WorkspaceTaskTabs() {