ERA-13861: Prompt for location permission on 'Use my location' and surface denied state - #1706
ERA-13861: Prompt for location permission on 'Use my location' and surface denied state#1706jeslefcourt wants to merge 8 commits into
Conversation
The report detail view is 46rem wide because that is the sidebar panel width. The community page renders it standalone in a centered full-viewport container, leaving the panel marooned with white space on either side. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rface denied state The public community page no longer requests geolocation at load, so the browser permission prompt fires when the reporter clicks 'Use my location'. When permission is denied, the location picker shows 'Location sharing blocked by browser' and ghosts the button (aria-disabled, click guard) on all surfaces; the permission-denied error toast is removed. Browsers without Permissions API geolocation support fall back to a memoized one-shot getCurrentPosition probe, kicked at community page load. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
@claude review |
There was a problem hiding this comment.
Pull request overview
Updates community event forms to handle geolocation permission denial and expands their layout.
Changes:
- Adds permission detection, blocked-state UI, accessibility behavior, and tests.
- Avoids mounting the global geolocation watcher on community routes.
- Adds translations and wider community-form styling.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/utils/location/permission-probe.js |
Adds memoized permission probing. |
src/utils/location/permission-probe.test.js |
Tests probe behavior. |
src/ReportManager/ReportDetailView/index.js |
Applies community-specific styling. |
src/ReportManager/ReportDetailView/styles.module.scss |
Widens community forms. |
src/LocationPicker/MenuPopover/index.js |
Adds denied-state handling. |
src/LocationPicker/MenuPopover/index.test.js |
Tests permission and focus behavior. |
src/LocationPicker/MenuPopover/styles.module.scss |
Styles blocked messaging and hover behavior. |
src/GetUserLocationButton/index.js |
Adds ghosting, guards, and toast suppression. |
src/GetUserLocationButton/index.test.js |
Tests disabled and error behavior. |
src/GetUserLocationButton/styles.module.scss |
Styles the ghosted button. |
src/CommunityPage/index.js |
Adds legacy-browser probing. |
src/CommunityPage/index.test.js |
Tests probe gating. |
src/index.js |
Conditionally mounts the geolocation watcher. |
src/i18n.js |
Bumps translation cache version. |
public/locales/en-US/components.json |
Adds English blocked message. |
public/locales/es/components.json |
Adds Spanish blocked message. |
public/locales/fr/components.json |
Adds French blocked message. |
public/locales/ne-NP/components.json |
Adds Nepali blocked message. |
public/locales/pt/components.json |
Adds Portuguese blocked message. |
public/locales/sw/components.json |
Adds Swahili blocked message. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…k on rejected permission query Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Addressed Copilot's review in 2381481:
|
|
@claude review |
…sion probe A denied click now flips the inline blocked state directly, covering one-time prompt dismissals that leave the permission at 'prompt' with no change event. The probe memoizes only granted results, uses cheap low-accuracy options, and the denied-error predicate requires the PERMISSION_DENIED constant. The status live region is always mounted so screen readers announce the denial, and prefixedRoutePattern normalizes a missing leading slash. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Since the
Reviewed-but-not-changed (deliberate): the load-time Safari probe stays (product decision — only way to detect a prior denial without the Permissions API); no watcher/redux refactors (non-community behavior is frozen for this PR); the stored-location fast path can serve a stale fix on the community page if a reporter moves between sites — flagged separately as a possible follow-up. |
…mmunity info loads Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Two approved follow-ups in 1d0137d:
|
🚀 PR Environment Deployed
Access: https://era-13861.dev.pamdas.org |
…o the stored position on transient errors Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Regression fix in $(git rev-parse --short HEAD): the freshness check made every stale-store click do a fresh high-accuracy read with |
Summary
Implements ERA-13861 (from support request ERCS-7991): on community input forms, clicking Use my location without a granted browser permission silently did nothing, because a page-load geolocation request had already consumed the browser's permission prompt.
GeoLocationWatcheris no longer mounted on the public community route, so the browser's permission prompt fires at click time. All other routes keep their existing load-time behavior.aria-disabled+ click guard, keeping the popover focus trap intact;aria-describedbyannounces the reason). Updates live via the Permissions APIchangeevent if the user denies mid-session.GetUserLocationButton's error toast is suppressed forPERMISSION_DENIEDonly (timeout / position-unavailable still toast).getCurrentPositionprobe, kicked at community page load.permissionBlockedMessagestring translated in all six locales;I18N_FILES_VERSIONbumped to 1.52.Test plan
jestacross LocationPicker, GetUserLocationButton, CommunityPage, utils, ReportManager, GeoLocationWatcher and all other consumers: all suites pass.eslint/stylelinton touched files: no new problems (pre-existing issues untouched).🤖 Generated with Claude Code