Repository navigation
feat(shopping): a US / Europe market switch for ChatGPT Shopping, with its source per market - #1459
Merged
Merged
Conversation
…h its source per market (#1278) - lib/shopping/markets: one country-to-market helper. US and US state codes map to the US; EU / EEA countries, the UK and Switzerland to Europe; anything else to none. Also the default market and each market's region codes. - getBrandMarketCountries reads the brand's domain countries and every prompt's location codes (paged past the 1,000-row cap). - The Shopping page opens on the US when the brand has US countries and on Europe when all of them are European. With no market it shows no switch and makes no source claim. The choice is remembered per brand in localStorage. - The switch shows where ChatGPT's products come from in each market and keeps ChatGPT Shopping cards to that market's regions in the card reads. Other platforms' cards are unaffected. A picked region already narrows every platform, so the switch then follows that region, and choosing a market clears the region.
…arket (#1278) - 00267 adds p_chatgpt_regions to shopping_overview. It narrows ChatGPT Shopping's results and cards only; null (the default) reads exactly what the function did before. The 6-argument version is dropped so PostgREST sees one candidate, and its grants are restored. Apply the migration before deploying the web. - loadShoppingOverview passes the market's regions only while the market filter applies (All regions picked), the same rule as the card reads. Reports call without it and are unchanged. Behaviour kept from the switch: - A brand opens on Europe only when every country is European; DE + TR gets no market, no switch and no claim. - Both markets are offered once a brand has one. - While a market applies, ChatGPT cards from other countries show only through the region filter. - The switch shows with shopping mode off, paused prompts count as the brand's countries, brands.region is not read, and a ChatGPT card with no region is left out under a market.
Merged
7 of 12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A US / Europe market switch for ChatGPT Shopping on the Shopping page, with where ChatGPT's products come from in each market.
web/src/lib/shopping/markets.ts):US-CA) map to the US.countryand every location code its prompts track, read past the 1,000-row cap (getBrandMarketCountries).00267_shopping_overview_chatgpt_marketaddsp_chatgpt_regions text[] default nulltoshopping_overview.Readiness, the Content Editor Shopping tab, the OpenAI index rows (#1281) and the Google Shopping listings (#1285) don't exist yet. They will share this helper and the switch's state.
Prod dry run (rolled back), on the brand with the most cards, as a member:
shopping_overviewtakes 62–119 ms over 30 and 90 days, with and without the US list.Related issue
Closes #1278
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)🤖 Generated with Claude Code