diff --git a/apps/server/src/orchestration-v2/ProviderEventIngestor.test.ts b/apps/server/src/orchestration-v2/ProviderEventIngestor.test.ts index 0149d43ac3..3f360dd14e 100644 --- a/apps/server/src/orchestration-v2/ProviderEventIngestor.test.ts +++ b/apps/server/src/orchestration-v2/ProviderEventIngestor.test.ts @@ -308,7 +308,7 @@ layer("ProviderEventIngestorV2", (it) => { const childThread: OrchestrationV2AppThread = { ...rootEvent.payload, id: childThreadId, - title: "Subagent: inspect package", + title: "inspect package", activeProviderThreadId: null, lineage: { parentThreadId: rootEvent.threadId, diff --git a/apps/server/src/orchestration-v2/SubagentProjection.ts b/apps/server/src/orchestration-v2/SubagentProjection.ts index d2bec48536..37176ed2e0 100644 --- a/apps/server/src/orchestration-v2/SubagentProjection.ts +++ b/apps/server/src/orchestration-v2/SubagentProjection.ts @@ -34,7 +34,7 @@ export function subagentThreadTitle(input: { return `${input.parentTitle} subagent ${input.ordinal}`; } const clipped = detail.length > 72 ? `${detail.slice(0, 69)}...` : detail; - return `Subagent: ${clipped}`; + return clipped; } export function makeSubagentChildThread(input: { diff --git a/apps/web/src/components/BranchToolbarBranchSelector.tsx b/apps/web/src/components/BranchToolbarBranchSelector.tsx index 8cae3fa155..9b37bed72d 100644 --- a/apps/web/src/components/BranchToolbarBranchSelector.tsx +++ b/apps/web/src/components/BranchToolbarBranchSelector.tsx @@ -33,6 +33,7 @@ import { useAtomCommand } from "../state/use-atom-command"; import { vcsEnvironment } from "../state/vcs"; import { cn } from "../lib/utils"; import { + THREAD_DETAILS_PANEL_CHEVRON_CLASS, THREAD_DETAILS_PANEL_ICON_CLASS, THREAD_DETAILS_PANEL_ROW_CLASS, } from "./chat/threadDetailsPanelStyles"; @@ -618,12 +619,9 @@ export function BranchToolbarBranchSelector({ ? `Open ${sourceControlPresentation.terminology.singular} #${branchPr.number} (${branchPr.state})` : ""; const openPrLink = useOpenPrLink(threadRef); - const panelPrStateClass = - branchPr?.state === "open" - ? "bg-emerald-500/10 text-emerald-700 dark:bg-emerald-400/10 dark:text-emerald-300" - : branchPr?.state === "merged" - ? "bg-violet-500/10 text-violet-700 dark:bg-violet-400/10 dark:text-violet-300" - : "bg-muted text-muted-foreground"; + const panelPrLabel = branchPr + ? `#${branchPr.number}${branchPr.title.trim() ? `: ${branchPr.title}` : ""}` + : ""; function renderPickerItem(itemValue: string, index: number) { if (checkoutPullRequestItemValue && itemValue === checkoutPullRequestItemValue) { @@ -775,7 +773,12 @@ export function BranchToolbarBranchSelector({ > {triggerLabel} - + {displayMode === "panel" && branchPr && branchPrStatus ? ( @@ -794,18 +797,7 @@ export function BranchToolbarBranchSelector({ - - View {sourceControlPresentation.terminology.shortLabel} #{branchPr.number} - - - + {panelPrLabel} {branchPrStatus.tooltip} diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 1f7ae7aa81..b97a267d99 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -91,6 +91,7 @@ import { resolvePathLinkTarget } from "~/terminal-links"; import { type DraftId, useComposerDraftStore } from "~/composerDraftStore"; import { readLocalApi } from "~/localApi"; import { + THREAD_DETAILS_PANEL_CHEVRON_CLASS, THREAD_DETAILS_PANEL_ICON_CLASS, THREAD_DETAILS_PANEL_ROW_CLASS, THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS, @@ -1696,8 +1697,8 @@ export default function GitActionsControl({ <> {!isRepo ? ( - ) : null} - {connectionIssue ? ( @@ -271,7 +215,7 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) { id="thread-details-version-control-heading" className="text-[11px] font-medium text-muted-foreground" > - Version control + Version Control
@@ -298,7 +242,11 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) { ); if (props.mode === "popover") { - return
{card}
; + return ( +
+ {card} +
+ ); } return ( diff --git a/apps/web/src/components/chat/ThreadRelationshipsControl.tsx b/apps/web/src/components/chat/ThreadRelationshipsControl.tsx index 90c45715c1..537d817595 100644 --- a/apps/web/src/components/chat/ThreadRelationshipsControl.tsx +++ b/apps/web/src/components/chat/ThreadRelationshipsControl.tsx @@ -4,7 +4,6 @@ import { useNavigate } from "@tanstack/react-router"; import { ArrowRightIcon, BotIcon, - GitBranchIcon, GitForkIcon, GitMergeIcon, LoaderCircleIcon, @@ -20,7 +19,6 @@ import { resolveMergeBackTargetThreadId, type ThreadRelationshipEdge, } from "../../lib/threadRelationships"; -import { newThreadId } from "../../lib/utils"; import { buildThreadRouteParams } from "../../threadRoutes"; import { useThreadProjection, useThreadShells } from "../../state/entities"; import { threadEnvironment } from "../../state/threads"; @@ -29,6 +27,15 @@ import { cn } from "../../lib/utils"; import { Button } from "../ui/button"; import { Menu, MenuItem, MenuPopup, MenuTrigger } from "../ui/menu"; import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; +import { + THREAD_DETAILS_PANEL_ICON_CLASS, + THREAD_DETAILS_PANEL_ICON_ACTION_CLASS, + THREAD_DETAILS_PANEL_LINK_ROW_CLASS, + THREAD_DETAILS_PANEL_LINK_SPLIT_GROUP_CLASS, + THREAD_DETAILS_PANEL_LINK_SPLIT_PRIMARY_CLASS, + THREAD_DETAILS_PANEL_LINK_SPLIT_SECONDARY_CLASS, + THREAD_DETAILS_PANEL_SPLIT_SEPARATOR_CLASS, +} from "./threadDetailsPanelStyles"; function relationshipLabel(edge: ThreadRelationshipEdge, currentThreadId: ThreadId) { if (edge.kind === "transfer") return "Context transfer"; @@ -45,7 +52,13 @@ function statusDotClass(status: string | null): string { return "bg-muted-foreground/45"; } -const MAX_VISIBLE_RELATIONSHIPS = 5; +function relationshipThreadTitle(input: { + readonly title: string; + readonly isSubagent: boolean; +}): string { + if (!input.isSubagent) return input.title; + return input.title.replace(/^Subagent:\s*/i, ""); +} export function ThreadRelationshipsPanel(props: { readonly environmentId: EnvironmentId; @@ -67,30 +80,10 @@ export function ThreadRelationshipsPanel(props: { ]; const graph = deriveThreadRelationshipGraph({ threads: shells, projection }); const navigate = useNavigate(); - const forkFromRun = useAtomCommand(threadEnvironment.forkFromRun); const mergeBack = useAtomCommand(threadEnvironment.mergeBack); const stopSession = useAtomCommand(threadEnvironment.stopSession); - const [busyAction, setBusyAction] = useState<"fork" | "merge" | "detach" | null>(null); + const [busyAction, setBusyAction] = useState<"merge" | "detach" | null>(null); const latestCompletedRun = projection?.runs.findLast((run) => run.status === "completed") ?? null; - const sourceProviderThread = - latestCompletedRun?.providerThreadId == null - ? null - : (projection?.providerThreads.find( - (thread) => thread.id === latestCompletedRun.providerThreadId, - ) ?? null); - const capabilities = - (sourceProviderThread === null - ? null - : projection?.providerSessions.find( - (session) => session.id === sourceProviderThread.providerSessionId, - )?.capabilities) ?? null; - const canForkNatively = - capabilities?.threads.canForkThread === true && - capabilities.threads.canForkFromTurn === true && - capabilities.identity.nativeThreadIds === "strong"; - const canFork = - latestCompletedRun !== null && - (canForkNatively || capabilities?.context.supportsFullThreadHandoff === true); const mergeTargetThreadId = resolveMergeBackTargetThreadId(projection); const relationshipRows = immediateThreadRelationships(graph, props.threadId).toSorted( (left, right) => @@ -103,7 +96,7 @@ export function ThreadRelationshipsPanel(props: { (session) => session.status !== "stopped" && session.status !== "error", ) ?? false; - if (relationshipRows.length === 0 && !canFork && mergeTargetThreadId === null && !canDetach) { + if (relationshipRows.length === 0) { return null; } @@ -114,23 +107,6 @@ export function ThreadRelationshipsPanel(props: { }); }; - const fork = async () => { - if (!latestCompletedRun || busyAction !== null) return; - setBusyAction("fork"); - const targetThreadId = newThreadId(); - const result = await forkFromRun({ - environmentId: props.environmentId, - input: { - sourceThreadId: props.threadId, - targetThreadId, - runId: latestCompletedRun.id, - title: `${projection?.thread.title ?? "Thread"} fork`, - }, - }); - setBusyAction(null); - if (result._tag === "Success") openThread(targetThreadId); - }; - const merge = async () => { if (!latestCompletedRun || mergeTargetThreadId === null || busyAction !== null) return; setBusyAction("merge"); @@ -156,8 +132,6 @@ export function ThreadRelationshipsPanel(props: { setBusyAction(null); }; - const visibleRows = relationshipRows.slice(0, MAX_VISIBLE_RELATIONSHIPS); - const hiddenRelationshipCount = relationshipRows.length - visibleRows.length; const parentTitle = mergeTargetThreadId === null ? null @@ -177,17 +151,6 @@ export function ThreadRelationshipsPanel(props: { Lineage
- {canFork ? ( - - ) : null} {canDetach ? ( @@ -213,69 +177,73 @@ export function ThreadRelationshipsPanel(props: {
- {visibleRows.length > 0 ? ( -