From d53fd984e953f3ad055e039aa09a01a2b2a45a84 Mon Sep 17 00:00:00 2001 From: Gavin Sonntag Date: Mon, 27 Apr 2026 15:59:18 -0700 Subject: [PATCH] fix: percent-encode track name in expo navigation The expo dropdown built the track URL with `t.replace(/\s/g, '%20')`, which only escapes spaces. A track name containing a slash (e.g. "AI/ML") got navigated to /expo/AI/ML, which the route /expo/:track interpreted as nested path segments and failed to match. Use encodeURIComponent so spaces, slashes, and any other reserved URL characters survive round-tripping through React Router. --- client/src/pages/Expo.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/pages/Expo.tsx b/client/src/pages/Expo.tsx index a142247..f3ddb1f 100644 --- a/client/src/pages/Expo.tsx +++ b/client/src/pages/Expo.tsx @@ -123,7 +123,9 @@ const Expo = () => { selected={track} setSelected={setTrack} onChange={(t) => { - navigate('/expo/' + t.replace(/\s/g, '%20')); + // encodeURIComponent handles spaces, slashes, and + // any other reserved URL characters in track names. + navigate('/expo/' + encodeURIComponent(t)); }} options={challenges ?? []} className="my-2 md:mx-0 mx-4"