From fe1e0171ffa7dd57f1de72dc620afb727a8b780d Mon Sep 17 00:00:00 2001 From: Justin Paul Date: Mon, 8 Jun 2026 15:15:39 -0400 Subject: [PATCH] Tree view: add "Back to default person" recenter link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Once you recenter the tree on someone, there was no quick way back to the tree's home/default person. Add a header link (shown only when a home person is set and you're not already on them) that recenters the chart on home_person_id via the existing goTo() — works in landscape, portrait, and fan modes. Labels with the home person's name for clarity. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Justin Paul --- frontend/app/trees/[id]/tree/page.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/app/trees/[id]/tree/page.tsx b/frontend/app/trees/[id]/tree/page.tsx index ce33b7c..af2547b 100644 --- a/frontend/app/trees/[id]/tree/page.tsx +++ b/frontend/app/trees/[id]/tree/page.tsx @@ -42,6 +42,8 @@ export default function TreePage() { const [events, setEvents] = useState([]); const [status, setStatus] = useState<"loading" | "empty" | "ready" | "error">("loading"); const [focusId, setFocusId] = useState(null); + // The tree's default/home person — lets us offer a "recenter on default" jump. + const [homeId, setHomeId] = useState(null); const [mode, setMode] = useState("landscape"); const [renderNote, setRenderNote] = useState(null); @@ -67,6 +69,7 @@ export default function TreePage() { setPeople(ppl); setRels(r.data ?? []); setEvents(e.data ?? []); + setHomeId(homeId); // Honor an explicit ?focus first (came from a person page / a shared // link), then the tree's default/home person, then the first person. const fromUrl = initialFocus.current && ppl.some((x) => x.id === initialFocus.current) @@ -288,6 +291,16 @@ export default function TreePage() { )} + {homeId && focusId !== homeId && ( + + )}
-- 2.52.0