Skip to content

Universal landing page; COUNTRY=universal#1954

Open
gislawill wants to merge 19 commits into
1763-feature-request-url-driven-country-context-for-any-country-deploymentfrom
gislawill/universal-landing-page
Open

Universal landing page; COUNTRY=universal#1954
gislawill wants to merge 19 commits into
1763-feature-request-url-driven-country-context-for-any-country-deploymentfrom
gislawill/universal-landing-page

Conversation

@gislawill

@gislawill gislawill commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds the universal global landing page and related map UX on top of 1763-feature-request-url-driven-country-context-for-any-country-deployment.

Landing page (/)

  • New left panel with searchable country list; map shows admin0 boundaries only
  • Click a country (list or map) to navigate to /country/:iso3
  • Hover highlight + styled tooltip on country outlines
  • Pseudo-countries whose raw ISO code starts with lowercase x are hidden from map and list
  • Country names displayed in normal (non-uppercase) font for readability

Transitions & navigation

  • Unified app routes so the map is not remounted between / and /country/:iso3
  • Animated camera zoom on country selection and when returning to global view
  • Back to global button fixed to the bottom of the layers panel: clears selected layers/analysis, navigates to /, and zooms back out

Invalid country handling

  • Unknown ISO3 URLs show a warning and fall back to the global landing view (replaces the unused UniversalPlaceholder)

How to test the feature:

  • Open / on the universal deployment: confirm searchable country list, admin0 map only, hover outline + tooltip, and no x*-prefixed entries
  • Confirm country names in the panel are displayed in normal case (not all caps)
  • Select a country via list or map click: confirm animated zoom to country, URL update, and switch to normal left-panel tabs
  • Toggle layers in a country view, then click Back to global: confirm layers/analysis reset, return to /, and animated zoom to world view
  • Visit /country/QQQ: confirm warning notification and fallback to global landing (not an empty map or placeholder page)

Checklist - did you ...

Test your changes with

  • REACT_APP_COUNTRY=rbd yarn start
  • REACT_APP_COUNTRY=cambodia yarn start
  • REACT_APP_COUNTRY=mozambique yarn start
  • Add / update necessary tests?
  • Add / update outdated documentation?

Screenshot/video of feature:

…-country-deployment' into gislawill/universal-landing-page
Show a warning notification so users know the country code is not available in PRISM.
…d global reset.

Add country hover highlight and styled tooltip, hide pseudo x-prefixed countries, unify routes to avoid map remounts, and add a back-to-global control that clears layers and zooms out.
…-country-deployment' into gislawill/universal-landing-page
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 4c790d8):

https://staging-prism-frontend--1954-fnd8s4nk.web.app

(expires Sun, 19 Jul 2026 18:24:17 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 4de97634797dc19a4f4938b370446c2b3ddc1c37

@gislawill gislawill marked this pull request as ready for review June 15, 2026 22:32
@ericboucher ericboucher changed the title Universal landing page Universal landing page; COUNTRY=universal Jun 16, 2026
…-country-deployment' into gislawill/universal-landing-page
@ericboucher

Copy link
Copy Markdown
Collaborator

@copilot use normal font for the universal panel instead of all cap default mui font

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@copilot use normal font for the universal panel instead of all cap default mui font

Fixed in commit Use normal font (no uppercase) in UniversalLandingPanel. The MUI theme sets text-transform: uppercase and letter-spacing: 3.5 globally on the body2 variant, which is used by the description text and country list items. Added textTransform: 'none' and letterSpacing: 'normal' overrides to the affected style classes (description, countryName, emptyState, loadingText).

@ericboucher

Copy link
Copy Markdown
Collaborator

@gislawill I updated fonts to make it more readable, hope that's ok with you!
Screenshot 2026-06-16 at 5 51 11 PM

@ericboucher

Copy link
Copy Markdown
Collaborator

@copilot fix frontend tests

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@copilot fix frontend tests

Fixed in commit Fix universal-utils test: update USA bbox to match antimeridian metadata. The test was written before commit 7018fb7e which updated USA's bbox in metadata.json to the antimeridian-crossing format [172.4617, 18.9104, -66.9499, 71.3652] (where SW lng > NE lng, handled correctly by MapLibre fitBounds). Updated the test expectation to match.

@ericboucher

Copy link
Copy Markdown
Collaborator

@copilot resolve merge conflicts and update

…anding-page

# Conflicts:
#	frontend/src/utils/universal-utils.test.ts

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve merge conflicts and update

Done — merged origin/1763 into the branch. The only conflict was in universal-utils.test.ts: kept both the landing-panel pseudo-country filter tests from this branch and the new resolveChartBoundaryProperty tests from the base branch, and used the upstream's antimeridian-aware longitude span calculation for the USA bbox assertion.

Show a spinner overlay while PMTiles admin boundaries load on the
universal landing page and during the transition into a country view.
The overlay anchors on the map idle event and dismisses only once the
displayed boundary sources are fully loaded, so cached low-zoom tiles
don't hide it before the high-res vectors finish, while later pan/zoom
within a view does not re-trigger it.
@gislawill

Copy link
Copy Markdown
Collaborator Author

@wadhwamatic, I just pushed up a loading state indicator for our pmtiles boundaries. Check it out and let me know what you think

Screen.Recording.2026-06-17.at.9.41.34.AM.mp4

@ericboucher ericboucher requested a review from Copilot June 17, 2026 15:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gislawill

gislawill commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

Note there's an issue on this branch with non-PMTiles deployments showing the loading states. Fix incoming.

Fixed

Standard GeoJSON deployments were showing the PMTiles loading spinner
because the overlay rendered unconditionally in MapView.
@gislawill

Copy link
Copy Markdown
Collaborator Author

@wadhwamatic, I've added the following disclaimer modal. Let me know what you think!
Screenshot 2026-06-17 at 8 22 46 PM

Show a dismissible beta notice on first load per tab session, covering map and dashboard routes in the universal deployment experience.
…-country-deployment' into gislawill/universal-landing-page
@wadhwamatic

wadhwamatic commented Jun 18, 2026

Copy link
Copy Markdown
Member

@gislawill - this is coming along nicely! Thanks for adding the loading state indicator and disclaimer. For the disclaimer, we can add this email address: wfp.prism@wfp.org

A few other inputs:

  1. I see an issue when going back from a country to the global list. I selected Cambodia in the left panel, and then clicked the back to global button. The list of countries is then limited to SE Asia:
Screenshot 2026-06-17 at 22 49 20
  1. When I select a country and then zoom out beyond it's extent, I expected to get back to a global selection option. Nice to have: could we prompt the user with a confirmation dialog ? It could read "Return to global?" with "Yes" / "No" options.

  2. I sent a message on Slack about missing chart data for Cambodia but maybe I'm misunderstanding where we are with that. We can discuss on Thursday.

…-country-deployment' into gislawill/universal-landing-page
… viewport.

The landing panel no longer builds its country list from map.querySourceFeatures, which returned only tiles in the current viewport and caused a truncated SE Asia list after returning from a country view.
@gislawill

Copy link
Copy Markdown
Collaborator Author

@wadhwamatic just pushed up some updates based on our conversation yesterday.

For the disclaimer, we can add this email address: wfp.prism@wfp.org

Done ✅

  1. I see an issue when going back from a country to the global list. I selected Cambodia in the left panel, and then clicked the back to global button.

Fixed ✅

  1. When I select a country and then zoom out beyond it's extent, I expected to get back to a global selection option. Nice to have: could we prompt the user with a confirmation dialog ? It could read "Return to global?" with "Yes" / "No" options.

Tracking future update in #1972

  1. I sent a message on Slack about missing chart data for Cambodia but maybe I'm misunderstanding where we are with that. We can discuss on Thursday.

Fixed ✅

@wadhwamatic

Copy link
Copy Markdown
Member

Thanks @gislawill for those last updates. I see another issue with charts. In Cambodia, when I select an admin 2 level area in the charts module, the name of the admin area reads '???????'

Screenshot 2026-06-19 at 13 35 02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants