Skip to content

Implement updates tracking OWID grapher#6

Open
xrendan wants to merge 633 commits intoBuildCanada:masterfrom
owid:master
Open

Implement updates tracking OWID grapher#6
xrendan wants to merge 633 commits intoBuildCanada:masterfrom
owid:master

Conversation

@xrendan
Copy link
Member

@xrendan xrendan commented Feb 26, 2026

Context

Links to issues, Figma, Slack, and a technical introduction to the work.

Screenshots / Videos / Diagrams

Add if relevant, i.e. might not be necessary when there are no UI changes.

Testing guidance

Step-by-step instructions on how to test this change

  • Does the change work in the archive?
  • Does the staging experience have sign-off from product stakeholders?

Reminder to annotate the PR diff with design notes, alternatives you considered, and any other helpful context.

Checklist

(delete all that do not apply)

Before merging

  • Google Analytics events were adapted to fit the changes in this PR
  • Changes to CSS/HTML were checked on Desktop and Mobile Safari at all three breakpoints
  • Changes to HTML were checked for accessibility concerns

If DB migrations exists:

  • If columns have been added/deleted, all necessary views were recreated
  • The DB type definitions have been updated
  • The DB types in the ETL have been updated
  • If tables/views were added/removed, the Datasette export has been updated to take this into account
  • Update the documentation in db/docs

After merging

  • If a table was touched that is synced to R2, the sync script to update R2 has been run

dependabot bot and others added 30 commits February 20, 2026 09:40
Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.7 to 7.5.9.
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v7.5.7...v7.5.9)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 7.5.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
🐛 (explorer) update query params when choices unavailable
## Description

- Configure the `user-survey-role-v1` experiment with three arms
- Add a new `UserSurvey` site widget (long-list, short-list, free-form experiment arms) with a follow-up feedback step
- Render the widget on eligible page contexts, skipping iframes and archive pages
- Add eligibility logic based on analytics consent, visit count, and first-visit age
- Add analytics event types and `SiteAnalytics` logging for submitting/dismissing the survey steps
- Add `POST /api/user-survey` in Cloudflare Functions with zod payload validation, Sentry error capture, and R2 persistence
- Add `USER_SURVEYS_R2` bucket bindings
- Centralize experiment cookie setting in middleware response handling (GET-only), extend static-asset skip to include `webp`

## Context

- [Notion](https://www.notion.so/owid/2026-01-21-User-survey-to-self-identify-as-a-certain-kind-of-user-2ef74b71f92e80c6a391ff7868671cea)
- [Figma](https://www.figma.com/design/PLD1bWikKmeDKSkEzqbUKf/User-Surveys?node-id=90-673&m=dev)

## Screenshots / Videos / Diagrams

### Long list variant

<img width="2934" height="1968" alt="image" src="https://github.com/user-attachments/assets/b6ef9d3f-b2c2-441c-8d35-cc91c20d508a" />

### Short list variant

<img width="2934" height="1968" alt="image" src="https://github.com/user-attachments/assets/0492fda2-6b2a-4a0d-8682-26582675281c" />

### Free-form variant

<img width="2934" height="1968" alt="image" src="https://github.com/user-attachments/assets/379c351d-49e5-4a80-a880-30cf574601bc" />

### Success screen

Shared for all variants.

<img width="2934" height="1968" alt="image" src="https://github.com/user-attachments/assets/54ac2c36-a930-4143-82bb-2448ca46e354" />

## Testing guidance

Focus on code structure and logical soundness. I'll double-check behavior, business logic, and interactions in the UI on a call with Bobbie.

- [x] Does the staging experience have sign-off from product stakeholders?

## Checklist

### Before merging

- [x] Google Analytics events were adapted to fit the changes in this PR
- [x] Changes to HTML were checked for accessibility concerns
- [x] Change the `expires` date of the experiment to be a month after launch
Use unique React keys (`${filter.type}:${filter.name}`) for autocomplete
suggestion list items. Previously, an exact topic match and the query
suggestion shared the same key (both keyed by `filter.name`), causing
React reconciliation to leave a stale duplicate element in the DOM when
the query changed.

Fixes #5524
- Make admin bar the highest.
- Make cookie notice the second highest. This fixes autocomplete
  obscuring the cookie notice buttons.

Fixes #5993
A traditional fix is to abort the request or ignore it in the useEffect
when the dropdown changes, but we were not able to implement that
correctly. See the issue for details.

#5727
Fixes #5524

## Problem

When typing a tag name with exact case (e.g. `Energy`) in the search bar:

1. The autocomplete shows both an **Energy topic** suggestion and an **Energy query** suggestion
2. Selecting the plain text query suggestion commits the search
3. Deleting a character (e.g. `Energ`) causes the **Energy tag to appear twice** in the autocomplete dropdown

## Root cause

Both the topic filter and query filter for "Energy" were rendered as `<li>` elements with `key={filter.name}` — both resolving to `key="Energy"`. When the suggestions updated (from the debounced query change), React's VDOM reconciliation failed to properly remove the stale duplicate element due to the non-unique keys.

## Fix

Changed the list item key from `filter.name` to `` `${filter.type}:${filter.name}` `` so that a topic suggestion and a query suggestion with the same name get distinct keys (e.g. `topic:Energy` vs `query:Energy`).

## Testing

1. Go to `/search`
2. Type `Energy` (exact case)
3. Select the plain text autocomplete suggestion (not the tag)
4. Delete 1 character → autocomplete should show `Energy` tag **only once**
Adds a chart type dropdown to SVG tester reports
## Context

This PR renames several variables and types related to regions and data providers to improve clarity and consistency in the codebase. The main changes include:

- Renamed `AGGREGATE_SOURCES` to `REGION_DATA_PROVIDERS`
- Renamed `AggregateSource` to `RegionDataProvider`
- Renamed `CUSTOM_REGION_SOURCE_IDS` to `ADDITIONAL_REGION_DATA_PROVIDERS`
- Renamed `CustomAggregateSource` to `AdditionalRegionDataProvider`
- Renamed `EntityRegionTypeGroup` to `RegionGroup`
- Renamed `entityNamesByRegionType` to `entitiesByRegionType`
- Renamed `getAggregatesBySource` to `getAggregatesByProvider`
- Renamed `isAggregateSource` to `isRegionDataProvider`

These changes make the terminology more consistent and better reflect the purpose of these variables and types.
This PR adds a new `SeriesLabel` component that renders column/entity labels with an optional info icon next to a region provider suffix (e.g. "Africa (WHO ℹ️)"). The icon shows a tooltip on hover, but the tooltip content is not yet implemented.

`SeriesLabelState.ts` prepares the data, `SeriesLabel.tsx` is responsible for rendering.

`SeriesLabel` handles three pieces of information:
- The name, e.g. 'Africa'
- The region provider suffix, e.g. '(WHO)'
- Optional formatted value (used in slope charts)

The region provider suffix and formatted value can never break into multiple lines. They're either rendered in the same line as the name, or placed in a new line (but both, the suffix and value, cannot be placed in the same line as the name).

Region provider suffixes are always shown in gray, even when no info icon is rendered (e.g. static exports). Static exports don't support region dods. Here, the region provider suffix is simply grey, without icon or appended note in the footer.

There are two render modes:
- If there is no icon, then we rely on the browser for the positioning/alignment (see `NativeAlignedLabelText`)
- If there is an icon, then that doesn't work because the icon must be rendered outside the `<text />` element, so we manually position all text elements and the icon 

The new `SeriesLabel` component is used wherever region dods are sensible:
- In line charts, slope charts, stacked area charts (by using it in LineLegend)
- In discrete bar charts and stacked discrete bar charts
- In facet charts

But not in:
- Vertical color legend (stacked bar charts sometimes come with a vertical color legend where the legend items might be entity names, but didn't seem important enough to integrate)
- Marimekkos (the fact that labels are rotated increases complexity quite a bit, which didn't seem worth the effort, given that most marimekkos only plot countries)
- Scatters (unlikely we want region dods here since the labels are plotted in the chart area)
Adds region dod support for income groups that are a bit different than normal regions because they don't come with a suffix. The icon just shows up after the name, e.g. 'High-income countries ℹ️'
Resolves #5518

Renders region tooltips that contain:
- A short description (checked in with D&R)
- An interactive map
- A legend

For now, this is only supported for a specific subset of region providers, but I'm looking into making this a bit more flexible in the next PR.
Adds wider support for region DODs: all providers listed in the regions file now support region DODs.

This doesn’t have any immediate effect because the un_m49_* regions ate the only ones missing, but they can’t be matched at the moment because they use the (UN) suffix in charts, but the regions file uses (UN M49) suffixes.

Going forward, if we add a new provider, it will automatically have region dods if added to REGION_DATA_PROVIDERS (and then any resulting type errors are fixed, e.g. by adding a description).
Use iframes on test pages instead of the multi embedder.

The reason I'm doing this now is that migrated chart configs on staging are not used on test pages. Instead of fixing the multi-embedder, I thought it's a good time to drop the multi-embedder on test pages since we plan to remove it in the future.

Only drawback as far as I can see is that some Grapher behaviour is iframe-specific, like adding the 'Explore the data ->' button.
ikesau and others added 30 commits March 9, 2026 17:17
Fixes issues I noticed in the markdown generated by Cloudflare across
our major content types.

- Changes several components to be HTML lists where appropriate
- Adds actual space between inline elements where CSS was used to add
  only visual space
- Changes links that contain block elements to be a block themselves -
  this might help with missing spaces in the markdown
- Render admin links only on the client - to exclude them from the
  markdown

https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/
don't need to always get the default style
Use ENV to pick archive directories: local `archive/` and
`wikipedia-archive/` in development, `/home/owid/live-data/` paths
on staging servers.
Add sed-based rewriting of detect-country.owid.io → ourworldindata.org/api/detect-country
in MJS bundles and source maps during Wikipedia archive backpopulation. Also adds BDD
feature tests to verify no requests leak to the old domain.
…opulate script (#6209)

## Context

The Wikipedia archive backpopulation script copies files from the main archive R2 bucket. Legacy archived `.mjs` bundles and source maps contain references to `https://detect-country.owid.io`, which has been replaced by `https://ourworldindata.org/api/detect-country` in newer builds. This PR adds a `sed`-based rewrite step to the backpopulate shell script to fix these URLs in the copied bundles.

## Changes

- **`devTools/backpopulateWikipediaArchive.sh`**: Added `rewrite_detect_country_urls_in_bundles()` step that uses `find`+`sed` to replace the legacy URL in `.mjs` and `.mjs.map` files. Updated the download and upload steps to also handle these file types.
- **`features/wikipedia-archive.feature`** + **`features/wikipedia-archive.steps.ts`**: Added BDD scenario verifying no requests go to `detect-country.owid.io` and that `/api/detect-country` is used instead. Refactored step definitions to use generic parameterized request-checking steps.

## Testing guidance

- `bash -n devTools/backpopulateWikipediaArchive.sh` — syntax check passes
- Unit tests pass: `yarn test run --reporter dot baker/archival/createWikipediaArchive.test.ts`
- Typecheck passes: `yarn typecheck`
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add parseAuthorRole() utility that extracts an optional role from author
strings like "Hannah Ritchie (writing)". The role is stripped before DB
lookups and author matching, and rendered outside the profile link in the
byline so it displays as: [Hannah Ritchie](/team/hannah-ritchie) (writing).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a range of widths at which we were manually setting the
dropdown position when we shouldn't have.

Fixes #5073
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
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.