Repository navigation
Conversation
A country in the Region selector plus a global popularity query now shows a banner suggesting `>= N% in REGION`. A query that already uses `in REGION` while the selector is Global suggests choosing that region in the selector. The query and the selector stay as the user set them, so `>1%` still returns the same browsers for every region. Rewriting the query was rejected in browserslist#444. Closes browserslist#446.
|
Can you show screenshot? |
|
Sorry, even with the screenshot I can't get what do you suggest. Can you tell me a simple step-by-step example? |
|
Example for #446. The note only suggests a change. It does not edit the query or the Region selector. Country selected, query has no region:
Query already has a region, selector is Global:
A yellow note that has a Fix link is the existing coverage warning. |
|
Sorry, your messages require a lot of my effort to be understood. Can you explain in a simple manner what do you want to fix? |
|
We want to fix this mix-up: with Region set to United States, |
No. It is REPL for Browserslist. It should show what Browserslist output on exactly the same query. |


Closes #446.
Summary
Suggest a region-aware popularity query when the Region selector and the typed query disagree. The banner is only a suggestion. It does not rewrite the textarea, and it does not change the Region selector.
That follows the rejection of #444.
>1%has to return the same browser list for every Region value. Automatically insertingin REGIONhid the fact that the result changed. The selector stays a coverage argument inserver/lib/get-browsers.js.Banners
Both banners render in
[data-id=form_messages], next to the existing lint messages, and are removed on the next submit the same way those messages are.Country selected, global popularity query. The selector is a country (not Global
alt-ww, and not a continent such asalt-as). The query has a browserslist popularity clause:>,>=,<, or<=, with the spacing browserslist already accepts (>= 1%,>=1%,> 1%,>1%, and the same forms with normal spacing). The banner recommends the same clause within REGION, for example>= 1% in FR. A clause that already saysin REGIONis not recommended again.in REGIONwhile the selector is Global. The query already has a popularity clauseina country or continent, and the selector is Global. The banner names that region and tells the user to choose it in the Region selector. It does not set the<select>.in alt-wwis not suggested, because that is already Global.in my statsandcoverare not treated as this case.<and<=are included because they are the same browserslistpopularity/popularity_in_placequery type as>and>=. A space before%(>= 1 %) is not, because browserslist does not parse that as a popularity query.Why nothing is applied for the user
The existing
buildWarning“Fix” link writes a newqinto the hash. This banner does not use that link. The recommended query is text. The Region sentence points at the selector and leaves its value alone. Region changes still callsubmitForm()and still do not edit the textarea.Tests
Client checks in
client/test/region-query-banner.test.jscover both directions and the non-cases (Global plus a plain>= N%, a continent, and a query that already hasin REGION). They run withnode --testand do not start the site.server/test/browsers.test.jschecks that>1%and>= 1%keep the same browser names and versions for global,alt-ww,alt-eu,US, andFR.pnpm teston this commit did not finish:prebuild:statsgot GitHub API 403 while fetching star counts. The checks below were run separately with Node 26.12.1 and pnpm 12.15.0 and passed: clienttest:run(19), servertest:run(19),oxlint .,stylelint .,node scripts/check-versions.js,pnpm audit --prod,vite build, andsize-limit. The script budget inclient/.size-limit.jsonis 16 KB (built script 15.33 KB). The download budget is still 60 KB (59.7 KB brotli).