[eric] apps: edit selected App in place, no duplicate on launch

This commit is contained in:
ciregenz
2026-06-24 18:29:34 -07:00
committed by ciregenz
parent 2ad3000562
commit 9ea40fbf7b
8 changed files with 101 additions and 2 deletions
@@ -407,6 +407,9 @@ const AgentChat: React.FC<AgentChatProps> = ({ sessionId: sessionIdProp, onClose
// session lands dashboard_id=null, drops out of the reconcile filter, and its card vanishes
// the instant you send (looked like "the chat quit when I clicked an option").
if (session?.dashboard_id) config.dashboard_id = session.dashboard_id;
// Editing an existing app: bind the launch to it so the backend edits in
// place instead of seeding a duplicate empty app (App Builder mode only).
if (msg.selectedAppIds?.length) config.selected_app_output_ids = msg.selectedAppIds;
dispatch(
launchAndSendFirstMessage({ draftId: id, config, prompt: msg.prompt, mode, model, images: msg.images, contextPaths: msg.contextPaths, forcedTools: msg.forcedTools, attachedSkills: msg.attachedSkills, selectedBrowserIds: msg.selectedBrowserIds, selectedAppIds: msg.selectedAppIds, selectedSettingIds: msg.selectedSettingIds })
).then((action) => {
@@ -49,6 +49,7 @@ interface Props {
forcedTools?: string[],
attachedSkills?: Array<{ id: string; name: string; content: string }>,
selectedBrowserIds?: string[],
selectedAppIds?: string[],
) => void;
onAddView: (outputId: string) => void;
onHistoryResume: (sessionId: string) => void;
@@ -213,8 +214,9 @@ const DashboardToolbar = React.forwardRef<HTMLDivElement, Props>(
forcedTools?: string[],
attachedSkills?: Array<{ id: string; name: string; content: string }>,
selectedBrowserIds?: string[],
selectedAppIds?: string[],
) => {
onSend(message, mode, model, images, contextPaths, forcedTools, attachedSkills, selectedBrowserIds);
onSend(message, mode, model, images, contextPaths, forcedTools, attachedSkills, selectedBrowserIds, selectedAppIds);
},
[onSend, mode, model],
);
@@ -127,6 +127,7 @@ export function useAgentSpawn({
forcedTools?: string[],
attachedSkills?: Array<{ id: string; name: string; content: string }>,
selectedBrowserIds?: string[],
selectedAppIds?: string[],
) => {
setToolbarOpen(false);
report('dashboard', 'agent_created', { mode, model, has_images: !!images?.length, has_context: !!contextPaths?.length, has_browser: !!selectedBrowserIds?.length });
@@ -148,6 +149,9 @@ export function useAgentSpawn({
}
const config: AgentConfig = { name: 'New chat', model, mode, dashboard_id: dashboardId };
// Editing an existing app: bind the launch to it so the backend edits in
// place instead of seeding a duplicate empty app (App Builder mode only).
if (selectedAppIds?.length) config.selected_app_output_ids = selectedAppIds;
dispatch(
launchAndSendFirstMessage({
@@ -161,6 +165,7 @@ export function useAgentSpawn({
forcedTools,
attachedSkills,
selectedBrowserIds,
selectedAppIds,
expand: expandNewChats,
}),
).then((action) => {
+1
View File
@@ -125,6 +125,7 @@ export interface AgentConfig {
max_turns?: number;
target_directory?: string;
dashboard_id?: string;
selected_app_output_ids?: string[];
}
export interface HistorySession {