Skip to content

Commit 2b68225

Browse files
committed
πŸ› chat with the specific agent when click chat icon in Agent Space
1 parent 9b3c1f9 commit 2b68225

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

β€Žfrontend/app/[locale]/page.tsxβ€Ž

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,11 @@ export default function Home() {
366366
onLoadAgents={loadAgents}
367367
onImportAgent={handleImportAgent}
368368
onChatNavigate={(agentId) => {
369-
// TODO: Store the selected agentId and pass it to ChatContent
370-
// For now, just navigate to chat view
369+
// Update URL with agent_id parameter for auto-selection in ChatAgentSelector
370+
const url = new URL(window.location.href);
371+
url.searchParams.set("agent_id", agentId);
372+
window.history.replaceState({}, "", url.toString());
373+
371374
setCurrentView("chat");
372375
saveView("chat");
373376
}}

β€Žfrontend/app/[locale]/space/components/SpaceContent.tsxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function SpaceContent({
6666
onChatNavigate(agentId);
6767
} else {
6868
// Fallback to URL navigation if callback not provided
69-
router.push(`/chat?agent=${agentId}`);
69+
router.push(`/chat?agent_id=${agentId}`);
7070
}
7171
};
7272

0 commit comments

Comments
Β (0)