From 87176fb29310d6dae217ffc2a9c3518ead38feba Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Mon, 23 Dec 2024 15:04:05 -0500 Subject: [PATCH] show most recent convo on homepage (#5769) --- frontend/src/api/open-hands.ts | 2 ++ frontend/src/routes/_oh._index/route.tsx | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/frontend/src/api/open-hands.ts b/frontend/src/api/open-hands.ts index 23694a09e70ce..9093514a63575 100644 --- a/frontend/src/api/open-hands.ts +++ b/frontend/src/api/open-hands.ts @@ -260,6 +260,8 @@ class OpenHands { args: params.args, selected_repository: params.selectedRepository, }); + // TODO: remove this once we have a multi-conversation UI + localStorage.setItem("latest_conversation_id", data.conversation_id); return data; } } diff --git a/frontend/src/routes/_oh._index/route.tsx b/frontend/src/routes/_oh._index/route.tsx index 64190bcd5836c..69f46dd0c2165 100644 --- a/frontend/src/routes/_oh._index/route.tsx +++ b/frontend/src/routes/_oh._index/route.tsx @@ -31,13 +31,15 @@ function Home() { gitHubClientId: config?.GITHUB_CLIENT_ID || null, }); + const latestConversation = localStorage.getItem("latest_conversation_id"); + return (
-
+
@@ -67,6 +69,19 @@ function Home() { />
+ {latestConversation && ( +
+

+ Or  + + jump back to your most recent conversation + +

+
+ )}
); }