From 083c67d01812cda4e15a459dc425bf74a052444c Mon Sep 17 00:00:00 2001 From: Davide Scaini Date: Wed, 8 Apr 2026 14:14:42 +0200 Subject: [PATCH] local activity storage and convert page fixes - Replace rdp dependency with inline pure-Python RDP implementation so the bincio wheel runs in Pyodide (no pure-Python wheel existed for rdp) - Fix convert page script: remove define:vars so Vite bundles it and TypeScript imports (localstore, format) work correctly - Rename wheel to proper PEP 427 filename (bincio-0.1.0-py3-none-any.whl) - Use en-GB date format on convert result, consistent with the feed - Add /activity/local/ page + LocalActivityDetail for IDB-only activities; feed links local activities there instead of the SSG route - Fix getStaticPaths: try public/data symlink as fallback, never crash on missing index.json - Fix ActivityDetail.onMount: load detail even when detail_url is absent so locally converted activities show map and charts - Derive track_url and detail_url from id in toSummary() since they are not present in the detail JSON - Reload on bfcache restore (pageshow) so client:only components re-mount after back navigation --- site/src/components/ActivityDetail.svelte | 3 +- site/src/components/ActivityFeed.svelte | 2 +- .../src/components/LocalActivityDetail.svelte | 27 ++++++++++++++++++ site/src/layouts/Base.astro | 7 +++++ site/src/lib/localstore.ts | 13 ++++++++- site/src/pages/activity/[id].astro | 28 ++++++++++++------- site/src/pages/activity/local/index.astro | 8 ++++++ site/src/pages/convert/index.astro | 5 ++-- 8 files changed, 77 insertions(+), 16 deletions(-) create mode 100644 site/src/components/LocalActivityDetail.svelte create mode 100644 site/src/pages/activity/local/index.astro diff --git a/site/src/components/ActivityDetail.svelte b/site/src/components/ActivityDetail.svelte index bf16b09..5632622 100644 --- a/site/src/components/ActivityDetail.svelte +++ b/site/src/components/ActivityDetail.svelte @@ -27,9 +27,8 @@ $: displayTitle = localTitle || activity.title; onMount(async () => { - if (!activity.detail_url) return; try { - detail = await loadActivity(activity.id, activity.detail_url, base); + detail = await loadActivity(activity.id, activity.detail_url ?? '', base); if (!detail) throw new Error('Activity not found'); } catch (e: any) { error = e.message; diff --git a/site/src/components/ActivityFeed.svelte b/site/src/components/ActivityFeed.svelte index a0e5240..3d3e466 100644 --- a/site/src/components/ActivityFeed.svelte +++ b/site/src/components/ActivityFeed.svelte @@ -111,7 +111,7 @@
{#each visible as a (a.id)} diff --git a/site/src/components/LocalActivityDetail.svelte b/site/src/components/LocalActivityDetail.svelte new file mode 100644 index 0000000..511f5f3 --- /dev/null +++ b/site/src/components/LocalActivityDetail.svelte @@ -0,0 +1,27 @@ + + +{#if error} +

{error}

+{:else if activity} + +{:else} +
+{/if} diff --git a/site/src/layouts/Base.astro b/site/src/layouts/Base.astro index 5d78e83..3d17273 100644 --- a/site/src/layouts/Base.astro +++ b/site/src/layouts/Base.astro @@ -21,6 +21,13 @@ const baseUrl = import.meta.env.BASE_URL ?? '/'; document.documentElement.setAttribute('data-theme', t); + + +