From a863cdd66378861c9c65ef919cb1a63a2584c351 Mon Sep 17 00:00:00 2001 From: Davide Scaini Date: Fri, 15 May 2026 00:49:46 +0200 Subject: [PATCH] Records: exclude Zwift activities by title; show Saved confirmation before closing drawer - _is_outdoor now also excludes activities whose title matches /\bzwift\b/i, covering the ~50 Strava-imported Zwift rides that lack sub_sport metadata. - EditDrawer waits 900ms after a successful save before dispatching 'saved' (which closes the drawer), so the green "Saved" confirmation is visible. --- bincio/extract/writer.py | 7 ++++++- site/src/components/EditDrawer.svelte | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bincio/extract/writer.py b/bincio/extract/writer.py index 1eb3d30..a37a011 100644 --- a/bincio/extract/writer.py +++ b/bincio/extract/writer.py @@ -278,9 +278,14 @@ def write_athlete_json(summaries: list[dict], output_dir: Path, athlete_config: return [[d, w] for d, w in sorted(best.items())] _INDOOR_SUB_SPORTS = {"indoor", "treadmill", "virtual"} + _INDOOR_TITLE_RE = re.compile(r'\bzwift\b', re.IGNORECASE) def _is_outdoor(s: dict) -> bool: - return s.get("sub_sport") not in _INDOOR_SUB_SPORTS + if s.get("sub_sport") in _INDOOR_SUB_SPORTS: + return False + if _INDOOR_TITLE_RE.search(s.get("title") or ""): + return False + return True all_mmps = [s["mmp"] for s in summaries if s.get("mmp") and _is_outdoor(s)] mmps_365 = [s["mmp"] for s in summaries if s.get("mmp") and _is_outdoor(s) and s["started_at"] >= cutoff_365] diff --git a/site/src/components/EditDrawer.svelte b/site/src/components/EditDrawer.svelte index c262027..06b0161 100644 --- a/site/src/components/EditDrawer.svelte +++ b/site/src/components/EditDrawer.svelte @@ -93,6 +93,7 @@ if (!res.ok) throw new Error(await res.text()); saveStatus = 'Saved'; saveOk = true; + await new Promise(r => setTimeout(r, 900)); dispatch('saved', { title, description }); } catch (e: any) { saveStatus = e.message;