No browser storage for referrals; the birth chart opens at the drawn chart
CI / test (push) Successful in 1m41s
CI / build (push) Successful in 5m22s
CI / deploy (push) Skipped

The share page stores nothing in the browser any more: the shared link
that brought a visitor travels in its login link (/belepes?ref=...) to
the Google, Apple and password sign-up. The backend counts the same
visitor of a link once in half an hour, instead of a sessionStorage flag.

The public birth chart scrolls to the drawn chart after a calculation
and when coming back to the page. Tabs scrolled to themselves on every
re-render of their parent when the address had a tab (#bolygok); they
now react only to the tab ids and hash changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-21 21:13:41 +00:00
co-authored by Claude Opus 5.5
parent b41dc31f3e
commit 8b8285b5d2
12 changed files with 60 additions and 61 deletions
+5 -2
View File
@@ -22,17 +22,20 @@ export function Tabs({ tabs, label }: { tabs: Tab[]; label: string }) {
const root = useRef<HTMLDivElement>(null);
// A link to #<tab> (on load, or from elsewhere on the page) opens that tab and scrolls to it.
// Keyed by the tab ids, not the array (new on every render of the parent),
// so a re-render does not scroll the page back to the tabs.
const ids = tabs.map((t) => t.id).join(" ");
useEffect(() => {
const open = () => {
const id = window.location.hash.slice(1);
if (!tabs.some((t) => t.id === id)) return;
if (!ids.split(" ").includes(id)) return;
setActive(id);
root.current?.scrollIntoView({ behavior: "smooth", block: "start" });
};
open();
window.addEventListener("hashchange", open);
return () => window.removeEventListener("hashchange", open);
}, [tabs]);
}, [ids]);
function choose(id: string) {
setActive(id);