From 656b45a9d2c0143402f73b945b5239373a8806df Mon Sep 17 00:00:00 2001 From: Mohd Kaif Ansari <155880242+techykaif@users.noreply.github.com> Date: Fri, 21 Aug 2026 23:55:00 +0530 Subject: [PATCH 1/2] fix(a11y): clarify geolocation errors --- src/components/map/near-me-button.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/map/near-me-button.tsx b/src/components/map/near-me-button.tsx index 28b9c17..f9aae7a 100644 --- a/src/components/map/near-me-button.tsx +++ b/src/components/map/near-me-button.tsx @@ -27,9 +27,15 @@ export function NearMeButton({ onLocated, className }: NearMeButtonProps) { setBusy(false); onLocated({ lat: pos.coords.latitude, lng: pos.coords.longitude }); }, - () => { + (err) => { setBusy(false); - setError("Could not read your location."); + setError( + err.code === err.PERMISSION_DENIED + ? "Allow location access in your browser settings." + : err.code === err.TIMEOUT + ? "Location request timed out. Try again." + : "Your location could not be determined. Try again.", + ); }, { enableHighAccuracy: true, timeout: 10000 }, ); @@ -47,7 +53,11 @@ export function NearMeButton({ onLocated, className }: NearMeButtonProps) { {busy ? "Locating..." : "Near me"} - {error &&

{error}

} + {error && ( +

+ {error} +

+ )} ); } From 4e30aff2bf9b42c31449b44a1a748986b807a16a Mon Sep 17 00:00:00 2001 From: Mohd Kaif Ansari <155880242+techykaif@users.noreply.github.com> Date: Fri, 21 Aug 2026 23:55:20 +0530 Subject: [PATCH 2/2] fix(a11y): clarify mobile geolocation errors --- src/components/map/near-me-fab.tsx | 54 ++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/src/components/map/near-me-fab.tsx b/src/components/map/near-me-fab.tsx index d3ebe0b..3dc9969 100644 --- a/src/components/map/near-me-fab.tsx +++ b/src/components/map/near-me-fab.tsx @@ -15,42 +15,60 @@ interface NearMeFabProps { /** Round floating "near me" button for the mobile map, sized for thumb reach. */ export function NearMeFab({ onLocated, className }: NearMeFabProps) { const [busy, setBusy] = React.useState(false); + const [error, setError] = React.useState(null); function locate() { if (!navigator.geolocation) { - toast.error("Geolocation is not available in this browser."); + const message = "Geolocation is not available in this browser."; + setError(message); + toast.error(message); return; } setBusy(true); + setError(null); navigator.geolocation.getCurrentPosition( (pos) => { setBusy(false); onLocated({ lat: pos.coords.latitude, lng: pos.coords.longitude }); }, - () => { + (err) => { setBusy(false); - toast.error("Could not read your location."); + const message = + err.code === err.PERMISSION_DENIED + ? "Allow location access in your browser settings." + : err.code === err.TIMEOUT + ? "Location request timed out. Try again." + : "Your location could not be determined. Try again."; + setError(message); + toast.error(message); }, { enableHighAccuracy: true, timeout: 10000 }, ); } return ( - + {error && ( + + {error} + )} - > - {busy ? ( - - ) : ( - - )} - + ); }