From 56932df33479ac054a103ffc81e375c4924cd7fe Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 22:13:00 +0000 Subject: [PATCH 1/4] Initial plan From 1225cbf872b4daa82e13a2e0404daa81a6ececf1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 22:17:23 +0000 Subject: [PATCH 2/4] Add account button with profile picture to home page Co-authored-by: notkainoa <123281048+notkainoa@users.noreply.github.com> --- src/routes/home.lazy.tsx | 13 ++++++++++++- src/views/HomePageStatic.tsx | 37 ++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/routes/home.lazy.tsx b/src/routes/home.lazy.tsx index 952ecda..696248d 100644 --- a/src/routes/home.lazy.tsx +++ b/src/routes/home.lazy.tsx @@ -1,6 +1,17 @@ import HomePageStatic from "@/views/HomePageStatic"; import { createLazyFileRoute } from "@tanstack/react-router"; +import { ProfileOverlayProvider } from "@/contexts/ProfileOverlayContext"; +import ProfileOverlay from "@/components/ProfileOverlay"; + +function HomePageWithProvider() { + return ( + + + + + ); +} export const Route = createLazyFileRoute("/home")({ - component: HomePageStatic, + component: HomePageWithProvider, }); diff --git a/src/views/HomePageStatic.tsx b/src/views/HomePageStatic.tsx index 0be6d93..a53f447 100644 --- a/src/views/HomePageStatic.tsx +++ b/src/views/HomePageStatic.tsx @@ -4,10 +4,14 @@ import isAuthenticated from "@/hooks/isAuthenticated"; import { useQuery } from "@tanstack/react-query"; import { useNavigate } from "@tanstack/react-router"; import { useEffect, useState } from "react"; +import { getLocalUser } from "@/db/auth"; +import { useProfileOverlay } from "@/contexts/ProfileOverlayContext"; +import { User } from "lucide-react"; export default function HomePageStatic() { const navigate = useNavigate(); const [loadingTimeout, setLoadingTimeout] = useState(false); + const { openProfile } = useProfileOverlay(); const { data, isLoading, error } = useQuery({ queryKey: ["user", "authenticated"], @@ -17,6 +21,14 @@ export default function HomePageStatic() { staleTime: 30000, // 30 seconds }); + const { data: profileData } = useQuery({ + queryKey: ["profile"], + queryFn: getLocalUser, + enabled: data === true, + refetchOnMount: true, + refetchOnWindowFocus: true, + }); + // Set a timeout for loading state to prevent infinite loading useEffect(() => { if (isLoading) { @@ -47,6 +59,31 @@ export default function HomePageStatic() { } return (
+ {/* Account button in top-right when authenticated */} + {data && ( +
+ +
+ )}