From cbac82a2ba970e266da2827022ae726836b57cbd Mon Sep 17 00:00:00 2001 From: Davide Scaini Date: Thu, 9 Apr 2026 21:44:38 +0200 Subject: [PATCH] =?UTF-8?q?Fix=201=20=E2=80=94=20new=20user=20pages=20404?= =?UTF-8?q?=20(server.py:228):=20=20=20After=20registration=20creates=20th?= =?UTF-8?q?e=20user's=20directories,=20it=20now=20calls=20=5Fwrite=5Froot?= =?UTF-8?q?=5Fmanifest(dd).=20This=20rewrites=20index.json=20to=20include?= =?UTF-8?q?=20the=20new=20handle's=20shard=20immediately.=20Since=20Astro?= =?UTF-8?q?=20dev=20re-evaluates=20getStaticPaths()=20on=20every=20request?= =?UTF-8?q?=20(reading=20that=20file),=20/u/pres/,=20/u/pres/stats/,=20and?= =?UTF-8?q?=20/u/pres/athlete/=20will=20resolve=20correctly=20as=20soon=20?= =?UTF-8?q?as=20the=20new=20user=20navigates=20there.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix 2 — invites link (athlete/index.astro:33): Added an Invites button (top-right, same style as "Edit profile") that starts hidden. When bincio:me fires and me === handle (you're on your own page), the subnav tabs are removed as before AND the invites button is revealed. Other visitors see neither. --- bincio/serve/server.py | 5 ++++ site/src/pages/u/[handle]/athlete/index.astro | 25 +++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/bincio/serve/server.py b/bincio/serve/server.py index 3b992a4..b2a01e3 100644 --- a/bincio/serve/server.py +++ b/bincio/serve/server.py @@ -229,6 +229,11 @@ async def register(request: Request) -> JSONResponse: (dd / handle / "activities").mkdir(parents=True, exist_ok=True) (dd / handle / "edits").mkdir(parents=True, exist_ok=True) + # Update root manifest so the new user's shard is discoverable immediately + # (Astro dev re-evaluates getStaticPaths() on each request from this file) + from bincio.render.cli import _write_root_manifest + _write_root_manifest(dd) + token = create_session(_get_db(), handle) resp = JSONResponse({"ok": True, "handle": handle}) _set_session_cookie(resp, token) diff --git a/site/src/pages/u/[handle]/athlete/index.astro b/site/src/pages/u/[handle]/athlete/index.astro index 16bd3d9..137186d 100644 --- a/site/src/pages/u/[handle]/athlete/index.astro +++ b/site/src/pages/u/[handle]/athlete/index.astro @@ -21,18 +21,29 @@ const athleteUrl = `${mergedBase}athlete.json`; ---
-

@{handle}

- +
+
+

@{handle}

+ +
+ +