Skip to content

Commit

Permalink
show most recent convo on homepage (All-Hands-AI#5769)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbren authored and d-walsh committed Dec 24, 2024
1 parent 846ab0f commit 87176fb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions frontend/src/api/open-hands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
17 changes: 16 additions & 1 deletion frontend/src/routes/_oh._index/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ function Home() {
gitHubClientId: config?.GITHUB_CLIENT_ID || null,
});

const latestConversation = localStorage.getItem("latest_conversation_id");

return (
<div
data-testid="root-index"
className="bg-root-secondary h-full rounded-xl flex flex-col items-center justify-center relative overflow-y-auto"
>
<HeroHeading />
<div className="flex flex-col gap-16 w-[600px] items-center">
<div className="flex flex-col gap-8 w-[600px] items-center">
<div className="flex flex-col gap-2 w-full">
<TaskForm ref={formRef} />
</div>
Expand Down Expand Up @@ -67,6 +69,19 @@ function Home() {
/>
</div>
</div>
{latestConversation && (
<div className="flex gap-4 w-full text-center mt-8">
<p className="text-center w-full">
Or&nbsp;
<a
className="underline"
href={`/conversations/${latestConversation}`}
>
jump back to your most recent conversation
</a>
</p>
</div>
)}
</div>
);
}
Expand Down

0 comments on commit 87176fb

Please sign in to comment.