Skip to content

feat(ui): Add region mapping disclaimer - #894

Merged
AlexAxthelm merged 6 commits into
mainfrom
feat/geography-region-disclaimer
Aug 18, 2026
Merged

feat(ui): Add region mapping disclaimer#894
AlexAxthelm merged 6 commits into
mainfrom
feat/geography-region-disclaimer

Conversation

@AlexAxthelm

@AlexAxthelm AlexAxthelm commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Adds the region-mapping disclaimer agreed on #800:

The mapping of any individual country or territory to a region reflects the mappings of the model used in the pathway. It does not reflect any opinion of RMI.

It lives in one place — REGION_MAPPING_DISCLAIMER in src/utils/geographyUtils.ts — and surfaces wherever a user meets a region→country mapping:

  1. Methodology page → Regions. The existing note is extended, not duplicated: it now reads "Note: {disclaimer} RMI does not make any statements on country delineations and/or conflicting territorial claims."
  2. Detail page. Appended, in italics, under the availability text in the ⓘ beside "Geographies".
  3. Geography filter dropdown. A footnote pinned under the option list. This needed a new optional footer slot on DropdownFacetShellMultiSelectDropdown; it's guarded on footer &&, so every other facet renders exactly as before.

Copy and placement only — no behavior change.

Closes #800. Part of #783 / epic #860.

Testing

npm ci && npm test -- --run && npm run lint && npm run format:check

422 tests pass. New coverage: ResourcesMethodologyPage.test.tsx (the page had no test file) asserts the disclaimer and the territorial-claims sentence each appear exactly once, guarding against a second near-duplicate note; SearchSection.test.tsx gains two tests asserting the footnote appears under Geography and not under other facets.

Manually, in PR Preview:

  • Resources → Methodology → expand "Regions" — one merged italic note, not two.
  • Search page → open the Geography dropdown — footnote at the bottom of the panel. Open Pathway Type and Policy Ambition — unchanged, no footnote.
  • Any pathway detail page (e.g. /pathway/IEA-APS-2024) — hover the ⓘ next to "Geographies": availability text, then the disclaimer in italics below it.

Note for reviewers

This can merge before or after #895 — the two branches both touch PathwayDetailPage.tsx and geographyUtils.ts, but in non-overlapping hunks. Verified by test-merging both directions: clean, identical result tree, and the merged combination passes the suite and lint.

Copilot AI lite review requested due to automatic review settings August 13, 2026 09:39
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

Expected version change and release notes:

1.16.0-dev.11 (v1.16.0-dev.10...feat/geography-region-disclaimer ) (2026-08-17T12:20 UTC)

Features

  • ui: Add region mapping disclaimer (dcf482b)

Other

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-894.westus2.2.azurestaticapps.net

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.

Pull request overview

Adds a standardized disclaimer clarifying that region→country mappings come from the pathway model and are not political statements, addressing Issue #800 across key UI surfaces.

Changes:

  • Introduces a shared REGION_MAPPING_DISCLAIMER constant as the single source of truth for disclaimer text.
  • Displays the disclaimer on the Resources Methodology page and in the Geography filter dropdown (via a new dropdown footer).
  • Extends the Pathway Detail “Geographies” tooltip to include the disclaimer and adds targeted UI tests for two of the three placements.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils/geographyUtils.ts Adds shared REGION_MAPPING_DISCLAIMER constant for reuse across UI.
src/pages/resources/ResourcesMethodologyPage.tsx Updates the Regions note to include the shared disclaimer text.
src/pages/resources/ResourcesMethodologyPage.test.tsx Adds tests ensuring the disclaimer and existing territorial-claims text render correctly.
src/pages/PathwayDetailPage.tsx Appends the disclaimer to the Geographies tooltip content.
src/components/SearchSection.tsx Adds the disclaimer as a footnote under the Geography facet dropdown.
src/components/SearchSection.test.tsx Tests that only the Geography dropdown shows the disclaimer footnote.
src/components/MultiSelectDropdown.tsx Threads a new footer prop through to the dropdown shell.
src/components/DropdownFacetShell.tsx Implements optional dropdown footer rendering for facet panels.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/components/DropdownFacetShell.tsx
Comment thread src/pages/PathwayDetailPage.tsx
Copilot AI review requested due to automatic review settings August 13, 2026 10:05
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-894.westus2.2.azurestaticapps.net

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 13, 2026 10:09
@AlexAxthelm
AlexAxthelm marked this pull request as ready for review August 13, 2026 10:10
@AlexAxthelm
AlexAxthelm requested a review from jacobvjk August 13, 2026 10:10
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-894.westus2.2.azurestaticapps.net

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/utils/geographyUtils.ts:12

  • REGION_MAPPING_DISCLAIMER is exported from geographyUtils.ts, which has module-level side effects and heavy deps (i18n-iso-countries + registerLocale). Importing this constant into routes like SearchSection/ResourcesMethodologyPage will pull that bundle + execute the side effect even when no country-name utilities are used, increasing route chunk size unnecessarily.

Consider moving this string to a lightweight constants module (e.g. src/utils/disclaimers.ts) and importing it from there in the UI, optionally re-exporting it from geographyUtils.ts for convenience.

// Approved wording from #800 (2026-08-10). Single source of truth for the
// region-mapping disclaimer, rendered on the methodology page, in the detail-page
// geography tooltip, and under the Geography filter dropdown — the three places a
// user meets a region→country mapping.
export const REGION_MAPPING_DISCLAIMER =

Copilot AI review requested due to automatic review settings August 13, 2026 11:28
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-894.westus2.2.azurestaticapps.net

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/pages/resources/ResourcesMethodologyPage.tsx:3

  • REGION_MAPPING_DISCLAIMER is imported from geographyUtils, which has a module-level i18n-iso-countries + locale JSON import/registration. Pulling that entire module into the Methodology page just to render a single copy string is likely to increase the page bundle unnecessarily. Consider moving the disclaimer text into a lightweight constants/copy module (and optionally re-export it from geographyUtils), so pages that only need the string don’t also pay for the country-name machinery.
import React, { useId, useState } from "react";
import { Link } from "react-router";
import { REGION_MAPPING_DISCLAIMER } from "../../utils/geographyUtils";

src/components/MultiSelectDropdown.tsx:100

  • DropdownFacetShell types summary as a string, but MultiSelectDropdown passes number | null (current.length / null). This is a real type mismatch (and can become a compile error if/when type-checking is enforced). Convert the value to a string at the call site (or widen DropdownFacetShell’s summary type) so the props contract is consistent.
      summary={summary}
      onClear={clear}
      menuWidthClassName={menuWidthClassName}
      triggerMinWidthClassName={triggerMinWidthClassName}
      footer={footer}

@jacobvjk

Copy link
Copy Markdown
Collaborator

We should probably add this to the info hover on the comparison page too @AlexAxthelm

@jacobvjk jacobvjk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is all functional and as expected, but we should add the disclaimer to the ComparisonPage (i) hover as well, not just to the DetailsPage

Copilot AI review requested due to automatic review settings August 17, 2026 09:07
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-894.westus2.2.azurestaticapps.net

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.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/pages/resources/ResourcesMethodologyPage.tsx:3

  • ResourcesMethodologyPage now imports REGION_MAPPING_DISCLAIMER from geographyUtils, which has module-level side effects (countries.registerLocale(en)) and pulls in i18n-iso-countries. Since this page only needs static copy, consider moving the disclaimer to a lightweight constants module (or re-exporting from one) to avoid coupling UI copy to a heavy util with side effects.
import React, { useId, useState } from "react";
import { Link } from "react-router";
import { REGION_MAPPING_DISCLAIMER } from "../../utils/geographyUtils";

src/pages/ComparisonPage.disclaimer.test.tsx:85

  • Typo/inconsistent reference: this suite is for #800 (and the file header comment says #800), but the describe block says #894, which can confuse future searches and traceability.
describe("ComparisonPage — geography disclaimer (#894)", () => {

@jacobvjk
jacobvjk self-requested a review August 17, 2026 09:10
jacobvjk
jacobvjk previously approved these changes Aug 17, 2026

@jacobvjk jacobvjk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

geographyLabel,
geographyVariant,
normalizeGeography,
REGION_MAPPING_DISCLAIMER,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@AlexAxthelm I added the same behavior to the Comparison page, this resolves my requested change. I also added a test for this. If we care to deduplicate the behavior, we could do that too

Copilot AI review requested due to automatic review settings August 17, 2026 12:19
@AlexAxthelm
AlexAxthelm requested a review from jacobvjk August 17, 2026 12:20
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-894.westus2.2.azurestaticapps.net

@AlexAxthelm

Copy link
Copy Markdown
Collaborator Author

@jacobvjk Noting #903 as something to solve later (that may push towards some shared component)

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.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/pages/ComparisonPage.tsx:352

  • The PR description says the disclaimer surfaces in 3 places (methodology page, detail page, geography filter), but this change also adds it to the ComparisonPage “Geographies” tooltip. If this is intentional, the PR description should be updated to include this additional surface; if it’s not intended, the disclaimer should be removed here to match the stated scope.
              tooltip={
                <>
                  <span className="block">
                    {GEOGRAPHY_AVAILABILITY_TOOLTIP}
                  </span>
                  <span className="mt-2 block italic">
                    {REGION_MAPPING_DISCLAIMER}
                  </span>
                </>

src/pages/ComparisonPage.disclaimer.test.tsx:85

  • The test suite label references “#894”, but this file’s own header comment and the PR context are about #800. This mismatch makes it harder to trace why the test exists.
describe("ComparisonPage — geography disclaimer (#894)", () => {

@AlexAxthelm
AlexAxthelm merged commit 9000ced into main Aug 18, 2026
13 checks passed
@AlexAxthelm
AlexAxthelm deleted the feat/geography-region-disclaimer branch August 18, 2026 09:05
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.

Disclaimer about region mappings

3 participants