chore(web): prune plan-sidebar leftovers after the inline-plans rework

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
Julius MarmingeandClaude Fable 5 committed 2026-08-15 16:51:27 +02:00
1 parent 807072b7c1
commit aded5afa3f
2 files changed
-52

No files matched your search

-46
View File
@@ -91,8 +91,6 @@ import {
deriveTimelineEntriesFromVisibleTurnItems,
deriveRevertTurnCountByUserMessageId,
deriveActiveWorkStartedAt,
deriveActivePlanState,
findSidebarProposedPlan,
findLatestProposedPlan,
hasActionableProposedPlan,
isLatestRunSettled,
@@ -474,11 +472,6 @@ type EnvironmentUnavailableState = {
readonly connection: EnvironmentConnectionPresentation;
};
type ThreadPlanCatalogEntry = {
readonly id: ThreadId;
readonly projection: OrchestrationV2ThreadProjection;
};
function eventPathContainsSelector(event: Event, selector: string): boolean {
const path = event.composedPath();
if (path.length === 0 && event.target) {
@@ -1740,29 +1733,6 @@ function ChatViewContent(props: ChatViewProps) {
const existingThreadKeys = new Set<string>([...serverThreadKeys, ...draftThreadKeys]);
return openTerminalThreadKeys.filter((nextThreadKey) => existingThreadKeys.has(nextThreadKey));
}, [draftThreadKeys, openTerminalThreadKeys, serverThreadKeys]);
const sourcePlanThreadRef = useMemo(() => {
const sourceThreadId = activeLatestRun?.sourcePlanRef?.threadId;
if (!activeThread || !sourceThreadId || sourceThreadId === activeThread.id) {
return null;
}
return scopeThreadRef(activeThread.environmentId, sourceThreadId);
}, [activeLatestRun?.sourcePlanRef?.threadId, activeThread]);
const sourceThreadProjection = useThreadProjection(sourcePlanThreadRef);
const threadPlanCatalog = useMemo<ThreadPlanCatalogEntry[]>(() => {
if (!activeThread || serverProjection === null) {
return [];
}
const entries: ThreadPlanCatalogEntry[] = [
{ id: activeThread.id, projection: serverProjection },
];
if (sourcePlanThreadRef && sourceThreadProjection !== null) {
entries.push({
id: sourcePlanThreadRef.threadId,
projection: sourceThreadProjection.projection,
});
}
return entries;
}, [activeThread, serverProjection, sourcePlanThreadRef, sourceThreadProjection]);
useEffect(() => {
setMountedTerminalThreadKeys((currentThreadIds) => {
const nextThreadIds = reconcileMountedTerminalThreadIds({
@@ -2321,20 +2291,6 @@ function ChatViewContent(props: ChatViewProps) {
}
return findLatestProposedPlan(serverProjection, activeLatestRun?.runId ?? null);
}, [activeLatestRun?.runId, latestRunSettled, serverProjection]);
const sidebarProposedPlan = useMemo(
() =>
findSidebarProposedPlan({
threads: threadPlanCatalog,
latestRun: activeLatestRun,
latestRunSettled,
threadId: activeThread?.id ?? null,
}),
[activeLatestRun, activeThread?.id, latestRunSettled, threadPlanCatalog],
);
const activePlan = useMemo(
() => deriveActivePlanState(serverProjection, activeLatestRun?.runId ?? undefined),
[activeLatestRun?.runId, serverProjection],
);
const showPlanFollowUpPrompt =
pendingUserInputs.length === 0 &&
interactionMode === "plan" &&
@@ -6410,8 +6366,6 @@ function ChatViewContent(props: ChatViewProps) {
respondingRequestIds={respondingRequestIds}
showPlanFollowUpPrompt={showPlanFollowUpPrompt}
activeProposedPlan={activeProposedPlan}
activePlan={activePlan}
sidebarProposedPlan={sidebarProposedPlan}
runtimeMode={runtimeMode}
interactionMode={interactionMode}
lockedProvider={modelPickerLockedProvider}
@@ -10,7 +10,6 @@ import type {
ScopedThreadRef,
ServerProvider,
ThreadId,
RunId,
RuntimeRequestId,
} from "@t3tools/contracts";
import {
@@ -196,7 +195,6 @@ import { toastManager } from "../ui/toast";
import {
BotIcon,
CircleAlertIcon,
ListTodoIcon,
LoaderCircleIcon,
PencilRulerIcon,
type LucideIcon,
@@ -550,8 +548,6 @@ export interface ChatComposerProps {
// Plan
showPlanFollowUpPrompt: boolean;
activeProposedPlan: LatestProposedPlanState | null;
activePlan: { runId?: RunId | null } | null;
sidebarProposedPlan: { runId?: RunId | null } | null;
// Mode
runtimeMode: RuntimeMode;
@@ -650,8 +646,6 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
respondingRequestIds,
showPlanFollowUpPrompt,
activeProposedPlan,
activePlan,
sidebarProposedPlan,
runtimeMode,
interactionMode,
lockedProvider,