feat: improve passthrough composer and session recovery (#1411)

This commit is contained in:
Carlos Florêncio
2026-06-17 19:01:42 +01:00
committed by GitHub
parent 1d61727df3
commit d8436dfd8f
36 changed files with 2139 additions and 449 deletions
@@ -41,7 +41,7 @@ import type { useChatPanelState } from "./use-chat-panel-state";
const PLAN_CONTEXT_PATH = "plan:context";
function buildSubmitMessage(
export function buildSubmitMessage(
message: string,
reviewComments: DiffComment[] | undefined,
pendingPRFeedback: import("@/lib/state/slices/comments").PRFeedbackComment[],
@@ -37,6 +37,7 @@ export type ChatInputEditorAreaProps = {
showRequestChangesTooltip: boolean;
hideSessionsDropdown?: boolean;
minimalToolbar?: boolean;
hideAgentControls?: boolean;
hidePlanMode?: boolean;
isAgentBusy: boolean;
onPlanModeChange: (enabled: boolean) => void;
@@ -126,7 +127,8 @@ export function ChatInputEditorArea(p: ChatInputEditorAreaProps) {
p;
const { isSending, onCancel, contextCount, contextPopoverOpen, setContextPopoverOpen } = p;
const { contextFiles, onImplementPlan, onEnhancePrompt, isEnhancingPrompt } = p;
const { isUtilityConfigured, hideSessionsDropdown, minimalToolbar, hidePlanMode } = p;
const { isUtilityConfigured, hideSessionsDropdown, minimalToolbar, hideAgentControls } = p;
const { hidePlanMode } = p;
const { onVoiceTranscript, onVoiceAutoSend } = p;
// Exclude auto-added plan context from the count — it's always present in plan mode
// and shouldn't by itself enable the send button.
@@ -195,6 +197,7 @@ export function ChatInputEditorArea(p: ChatInputEditorAreaProps) {
onVoiceAutoSend={onVoiceAutoSend}
hideSessionsDropdown={hideSessionsDropdown}
minimalToolbar={minimalToolbar}
hideAgentControls={hideAgentControls}
hidePlanMode={hidePlanMode}
/>
</div>
@@ -91,6 +91,7 @@ type ChatInputContainerProps = {
onImplementPlan?: (fresh: boolean) => void;
hideSessionsDropdown?: boolean;
minimalToolbar?: boolean;
hideAgentControls?: boolean;
/** Hide the plan mode toggle button (for ephemeral/quick chat sessions) */
hidePlanMode?: boolean;
};
@@ -304,6 +305,7 @@ function buildEditorAreaProps(
onVoiceAutoSend: extras.onVoiceAutoSend,
hideSessionsDropdown: p.hideSessionsDropdown,
minimalToolbar: p.minimalToolbar,
hideAgentControls: p.hideAgentControls,
hidePlanMode: p.hidePlanMode,
};
}
@@ -78,6 +78,8 @@ export type ChatInputToolbarProps = {
hideSessionsDropdown?: boolean;
/** When true, only render the submit/cancel button — no other controls */
minimalToolbar?: boolean;
/** Hide ACP/session-specific controls while keeping Plan, attachment, and context controls */
hideAgentControls?: boolean;
/** Hide the plan mode toggle button (for ephemeral/quick chat sessions) */
hidePlanMode?: boolean;
};
@@ -376,7 +378,9 @@ function buildCollapsibleItems(props: {
onEnhancePrompt?: () => void;
isEnhancingPrompt: boolean;
isUtilityConfigured: boolean;
hideAgentControls?: boolean;
}): ToolbarItemConfig[] {
if (props.hideAgentControls) return [];
return [
{
id: "mcp",
@@ -456,6 +460,7 @@ function AttachFilesButton({ onClick }: { onClick: () => void }) {
size="sm"
className="h-7 gap-1.5 px-2 cursor-pointer hover:bg-muted/40"
onClick={onClick}
data-testid="chat-attachments-button"
>
<IconPaperclip className="h-4 w-4" />
</Button>
@@ -513,6 +518,7 @@ const toolbarDefaults = {
contextFiles: [] as ContextFile[],
isEnhancingPrompt: false,
isUtilityConfigured: false,
hideAgentControls: false,
hidePlanMode: false,
};
@@ -571,6 +577,7 @@ export const ChatInputToolbar = memo(function ChatInputToolbar(rawProps: ChatInp
variant="ghost"
size="sm"
className="h-7 gap-1.5 px-2 cursor-pointer hover:bg-muted/40 relative"
data-testid="chat-context-button"
>
<IconAt className="h-4 w-4" />
{props.contextCount > 0 && !isCollapsed && (
@@ -551,6 +551,7 @@ function useEditorImperativeHandle(
const { kind, path, label } = node.attrs;
if (kind === "file") mentions.push({ path, name: label, pinned: false });
else if (kind === "prompt") mentions.push({ path, name: label, pinned: false });
else if (kind === "plan") mentions.push({ path, name: label, pinned: false });
}
});
return mentions;