From 030f4115e0b5063b8d9151497c0b7c7f59b3fd3d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 07:58:22 +0000 Subject: [PATCH 1/2] Initial plan From ba162e8e28dd1d07eaa12cbff0e2b81b969b5ad7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 08:06:51 +0000 Subject: [PATCH 2/2] Fix GPX duplicate upload: pass displayPoints for Mapbox preview and route URL When a duplicate GPX file is detected and the user clicks "Use Existing File", the fetchExistingFileContent function now passes displayPoints to onFileParsed for Methods 1 (Firestore cache) and 2 (Storage reference). This ensures the Mapbox route preview renders and the route URL is properly generated. Changes: - Added displayPoints to DuplicateFile interface - Read displayPoints from Firestore document in checkForDuplicate - Pass displayPoints in Method 1 (Firestore cache) - Pass displayPoints in Method 2 (Storage ref) with processGPXUpload fallback Co-authored-by: aleexwong <65264501+aleexwong@users.noreply.github.com> --- .../src/components/elevationfinder/GpxUploader.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/vite-project/src/components/elevationfinder/GpxUploader.tsx b/vite-project/src/components/elevationfinder/GpxUploader.tsx index c35a603..c6a558a 100644 --- a/vite-project/src/components/elevationfinder/GpxUploader.tsx +++ b/vite-project/src/components/elevationfinder/GpxUploader.tsx @@ -45,6 +45,7 @@ interface DuplicateFile { content?: string; // Optional: content stored in Firestore storageRef?: string; // Storage reference path docId?: string; // Firestore document ID + displayPoints?: Array<{ lat: number; lng: number; ele?: number }>; // Cached display points for map preview } export default function GpxUploader({ @@ -108,6 +109,7 @@ export default function GpxUploader({ content: data.content, // Include content if stored storageRef: data.storageRef, docId: duplicateDoc.id, // Include document ID for reference + displayPoints: data.displayPoints, // Include cached display points for map preview }; } @@ -320,7 +322,8 @@ export default function GpxUploader({ duplicateFound.content, filename, fileUrl, - duplicateFound.docId || null + duplicateFound.docId || null, + duplicateFound.displayPoints ); return; } @@ -337,7 +340,13 @@ export default function GpxUploader({ } const content = await response.text(); - onFileParsed(content, filename, freshUrl, duplicateFound.docId || null); + onFileParsed( + content, + filename, + freshUrl, + duplicateFound.docId || null, + duplicateFound.displayPoints || processGPXUpload(content).displayPoints + ); return; }