Repository navigation
feat(action-center): open a Fix action for a live page that links products no longer for sale, and close it once fixed (shopping path, part 7b) - #1616
Merged
Conversation
…m issues (00296, ansvisor#1270 part 1) A Merchant Center account becomes a catalog source, read with the workspace's own Google sign-in through Composio (like Search Console and Analytics), so the token never reaches us. Calls go to the Merchant API v1 through Composio's proxy. - Connector merchant_center: lists the accounts the sign-in opens (plus an advanced account's sub-accounts), checks the picked one, reads every product page (1,000 a page) into the feed parsers' item shape (price from micros, first GTIN, availability and condition enums), keeps an offer listed again under another language or feed label once, and returns each product's item-level issues. syncOrders is a no-op. - 00296 catalog_item_issues: code, severity, attribute, reporting context, description per item; replaced each sync, removed with the source; members read, the server writes. - Plumbing: sign-in connectors (signIn instead of fields/connect), lib/catalog/sign-in.js (proxy request with 429/5xx waits, 'auth' when the sign-in is gone or refused), issue counts on last_counts, plain "Reconnect it in Settings › Integrations" words. - API: GET /api/catalog/accounts, POST /sources with input.account, signIns in GET /connectors, googleMerchantCenter in /integrations/config. - Tests with fixtures: paged list, items with and without issues, expired and refused sign-in, 429 wait, account picker, not set up. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…account in Settings › Integrations (ansvisor#1270 part 2) - Settings › Integrations gets a "Stores and marketplaces" group: a Google Merchant Center card that connects the workspace's Google sign-in like Search Console and Analytics, then lets the active brand pick one of the accounts it opens (GET /api/catalog/accounts) and add it as a catalog source. - Product catalog names the account "Google Merchant Center · Name (id)" and its row reads "N products · M with issues · synced …"; no sign-in button for it (the sign-in is the workspace's). The card reads its sources again when an account is added above. - The Shopping page's My Products tab links to Settings › Integrations to bring in the catalog. - catalog-client: signIns in listStoreConnectors, listSignInAccounts, connectSignInAccount, not_connected; CatalogCounts.issues; IntegrationProvider 'google-merchant-center'. Words in en.json. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and keep repeated offers' issues (ansvisor#1270 review) - sign-in.js: Composio's own 401/403 and Google's 403 are not_set_up, not auth; each refusal is logged by name, status and Google's reason; only the connector's hosts (merchantapi.googleapis.com) are reached. - An offer listed again under another language or feed label is counted on its own (last_counts.repeated), its issues gathered from every listing, and the kept one chosen by a fixed rule (no DISAPPROVED issue, then feed label, then content language). - Account listing and connecting share a 30 s deadline; the sub-account walk stops on a rate limit; a catalog cut at the page limit says so. - entityIdFor moves to composio.js. Tests for paging, deadlines, limits, the proxy helper and the refusal codes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… integrations by kind, and say what the catalog is for (ansvisor#1270 review) - The picked account belongs to the brand it was picked for: switching brands clears it, an add goes to the brand clicked for, one add at once. Accounts already added are marked and can't be picked; a failed list read offers Try again; members get their own line. - Integrations' group headings are h3 headings; Webflow moves to a "Content management systems" group (IntegrationGroup). - Shopping › My Products' catalog note says what the catalog does (the editor's product-page checks), only while the brand has no source. - "1 with an issue"; a fixed platform name before /connectors is read; stores.errors.not_connected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r' into feature/merchant-center-settings
…eated offers, and note advanced accounts (ansvisor#1270 review) - settings.merchantCenter.errors.not_configured says who fixes it (the server's set-up, or the Google account's access), with Try again. - A source's line shows "N listed again, kept once" (last_counts.repeated). - With several accounts, a note says an advanced account holds no products: pick the store's own sub-account. - Every StoreError has a message (checked at typecheck); the Shopping note is _catalog-note.tsx. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… site (00350, shopping path part 1) The shopping path links a buying guide or a comparison to the category's own page, so each catalog category is matched, on every read, to one of the brand's site pages whose address reads as a category page (the editor's page-type rule: /collections/, /category/, /c/, /shop/, WooCommerce's /product-category/; never a product page or a themed collection). Best match: the last path segment is the category's name, then the title or h1 holds it, then most of its words; ties go to the more cited, then visited page. - 00350: catalog_category_pages keeps a person's decision (a page, or none) by category name; catalog_category_counts(brand) gives live products and how many are in stock (service role only). - lib/catalog/category-pages.js: categorySlug, matchCategoryPages, categoryPages(brandId), setCategoryPage (page must be on the brand's domains). - API: GET /api/catalog/categories (members), PUT and DELETE (admins and managers). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rations and let admins change it (shopping path part 1) - Category pages, under the product catalog in Stores and marketplaces: each category of the active brand with its products and how many are in stock, its page on the site, and how it was found (its address or title names the category, most of its words, set by hand). Shown once the catalog has categories. - Admins and managers change a page (it must be on the brand's site), set none, or put a hand-set one back to the automatic match; members see the table. - catalog-client: listCategoryPages, setCategoryPage, resetCategoryPage; words in settings.catalog.categories. - The API calls a person's decision 'manual' whether it's a page or none. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…(00351, shopping path part 2)
On an online shop, a buying guide, a best-of list or a comparison links the
right category page and products in stock that Merchant Center accepts. The
API picks them for the draft's topic and keeps them on the draft:
- Topic: the title's words count 3, the brief's keywords 2, its goal and
headings 1.
- Categories: with a page on the site (00350) and stock, the best first,
a second only when it scores half the first's (2 at most).
- Products: the picked categories' first, then the brand's (2,000 scored,
the best 40 read in full); offered when they have a link, a variant in
stock and Merchant Center doesn't refuse that variant; the cheapest such
variant's price, and its non-refusing issues (e.g. missing GTIN). How
many by page type: best-of 8, buying guide 5, comparison and
alternatives 4, guide 4, blog post 3. The best left out are kept with
why (sold out, refused, no link).
- The person's choices survive a rebuild: locked and added products stay
(counted in the page's number), removed ones never come back.
- 00351 content_drafts.shopping_path jsonb (64 KB at most); members edit
it like the brief.
- POST /api/content-drafts/:draftId/shopping-path { brandId }: { path },
or { path: null, reason } ('not_a_shop', 'page_type', 'no_catalog').
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s Brief tab (shopping path part 3) Brief › Shopping path, above the brief, for a page type that links products (best-of, buying guide, comparison, alternatives, guide, blog post) on an e-commerce brand: - Pick from the catalog the first time (POST /:draftId/shopping-path), Pick again after; why a draft takes none (not a shop, page type, no catalog). - The category page with where it goes (in the intro and at the end). - Each product with its price (sale price first, en-US in its currency), In stock or Low stock, its Merchant Center issues, and its place by page type (Top picks #n, Compared #n, linked in the text). - Lock (kept when picked again or rewritten), Remove (saved at once), Swap (removed, then picked again for the next best), Add product (search the catalog's names, then picked again with it kept). - The best products left out, with why (sold out, Merchant Center refuses it, no page to link). - actions/shopping-path.ts: read and save through RLS like the brief, build through the API, search the catalog. lib/content/shopping-path.ts: the path's schema, which pages take one, places, changes. Words in contentEditor.editor.shopping; shopping_path in types/supabase.ts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ts only (shopping path part 4) The Content Agent now writes with the draft's shopping path: - A new page: the writer is told the category page (name it in the opening, point to it again at the end) and the products in order with the catalog's price and stock only, never another spec (a placeholder instead). It writes text, so the names it wrote are linked afterwards (shopping-links.js linkShoppingPath): each target the first time a paragraph or a list item names it, never in a heading or inside a link; products first, longest names first; a category's last word singular or plural too. - A page it changes (rewrite from brief, suggestions, rule fixes): the path's pages join the pages it may link to, first in the prompt whatever the rules, and in the allow list (anything else is still unwrapped). - The path's names and prices are given to the number and people guards, so the catalog's price isn't turned into a placeholder. - content-links.js: linkTargetsPrompt and linkAllowList read targets.shopping; startDraftWriting and fixDraftRules read shopping_path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… hand or with the agent (shopping path part 5) - + Insert › Products (the toolbar and the empty-line menu), on an online shop's draft: search the catalog by name, pick 1 to 4, Insert. One shows as a card, more as a grid: each product's picture, name and price (its cheapest variant in stock, sale price first), linked to its page. An HTML block with inline styles and no words of its own, so every export and CMS shows it as written, in any language. - The agent's new page on a list, a buying guide or a comparison with two products or more gets the same grid from its shopping path, at the end of the section that links the products most (else before the last H2, else at the end). - The markup is written twice, web (lib/content/product-block.ts) and server (lib/shopping-blocks.js); both tests expect the same string. - actions/shopping-path.ts getProductsForBlock reads products, variants and images through RLS; catalog_images added to types/supabase.ts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s own rule (shopping path part 1 review) - A malformed % in a page address no longer breaks the read. - Pages and categories are prepared once, with a word index; site_pages isn't read when nothing can match. - GET uses the general limiter; PUT/DELETE get their own bucket. - The category-page rule is the editor's (page-types.ts), checked on both sides by one fixture list; /blog/category/ and pages marked first (best-of, size guides, -vs-, policies) aren't category pages. - Parent words count; a one-word category matches by address only. - Turkish and German letters fold (lib/letters.js, shared with Webflow). - The table is read again when sources change; editing resets per brand. - catalog_category_counts counts the web's four in-stock values. - PUT refuses a category the catalog doesn't have; messages fit the routes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…publish (shopping path part 6) On an online shop's page with a shopping path: - Rules › Links and sources gets three Shopping rules: it links its category page; it links the path's products (3 by default, or all of a smaller path; a product card or grid counts); and none it links is sold out, refused by Merchant Center for free listings, or gone from the catalog. The last isn't the agent's to fix (NOT_FOR_AGENT). - Before you publish gets a Shopping links row: the products to swap by name and why, else a missing link to the category page, else how many work. Read fresh when it opens. - readPage reads the links inside HTML blocks too (htmlBlockLinks). - getShoppingCheck reads the path's products against the catalog now (in stock as feed-match.ts reads it; a refusal counts for FREE_LISTINGS or no destination); useShoppingCheck feeds the rules and the dialog. - catalog_item_issues added to types/supabase.ts; words in contentEditor.editor.rules and beforePublish.shopping. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…talog row, with one stock rule (shopping path part 2 review) - Locked and added products are read by id from the brand's own catalog, always kept; a removed or unknown one is left out as 'gone'. - Every read is chunked and paged past PostgREST's 1,000-row cap. - The route has its own bucket (shoppingPathLimiter); descriptions are cut to 400 characters once read. - More stop words and years, letters folded as category pages do, and 'no_match' when nothing fits. - A refusal counts only for free listings or an empty context. - One stock list (catalog/stock.js), the same as feed-match.ts and 00350. - The saved path is read through Zod; a bad one is taken as none and logged. Writes are capped to 64 KB and conditional on builtAt/savedAt (409 'changed'). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The table was 640 px wide in a 417 px card at 1024 px. The Change buttons sat out of sight, and the header's screen-reader label, outside the scroll box, scrolled the whole page sideways. - How a page was found is now a line under it, so four columns fit. - While a category is being changed, its form takes the button's cell as well. - The scroll box contains its label (`relative`). - Addresses wrap only where they must ([overflow-wrap:anywhere]). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… new path shape (shopping path part 3 review) - The schema takes the API's shape: 'gone' and a missing title for a product left out, 'no_match', savedAt, availability in lowercase with underscores, and the same caps as the server. A reason it doesn't know reads as a general line instead of failing. - A change is saved before the path is picked again, so a failed pick (429, 502) doesn't lose it. - A save writes only locked, removed and added, and only over the path that was read (builtAt and savedAt). Otherwise it answers 'changed' and the tab reads the path again. A build's 409 'changed' and 429 have their own lines. - An unreadable saved path, 'no_match' or an unknown reason offers "Pick from the catalog". - Links must be http(s); others show without a link. - The search has its own error; the Lock button has a fixed name with aria-pressed. - Removed: the unused fromCatalog string. - Rows are keyed by their place and name; the category path wraps with [overflow-wrap:anywhere]. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the catalog and the brand's site give them (shopping path part 4 review) - shoppingPathFor reads the path once per run through readShoppingPath. A bad shape counts as no path and is logged; the run goes on. - Prices pass in their usual forms ($189, 189 USD, ₺1.299,00), with the sign matching the currency; any other price becomes a placeholder. - Stock is read fresh from catalog_variants at write time and named through stock.js. Unknown stock says nothing. - Links: https and the brand's own domains only (brandSite, shared with category pages). - Product names match case-sensitively and category names don't. Letters are folded, and singulars come from category pages. - The fix path guards prices and names too. - A name or address is used once. A product name's numbers are free only where the name stands. - The prompt takes as many products as the page type links, 40 at most, locked and added ones kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…uct-blocks # Conflicts: # server/src/lib/content-writer.js
…he grid as a list (shopping path part 5 review)
- The agent's grid takes only products in stock, counted after the
filter, with the price and stock read fresh by shoppingPathFor.
- Insert › Products:
- A product is offered only when it's in stock and has an https page.
Search hits show the price, or "Sold out" or "No page to link", and
can't be picked when they're out.
- At insert, a product sold out meanwhile is left out with a toast.
- Each product's variants and image are read on their own: no shared
row cap; an image with no variant first.
- The cheapest variant in stock is picked by sale_price ?? price, with
one stock reading shared with feed-match.ts (variantStock).
- Cancel or Esc while inserting inserts nothing.
- The search has its own error; picks survive a new search and can be
taken back; Insert shows it's working; the count is aria-live.
- The markup has spaces and line breaks, so text exports read each
product apart. Webflow gets the grid as a <ul> list. Links are https,
without tracking or a hash, the same on both sides (a shared
fixture). A price of 0 is none; a sale price counts only under the
price, for the agent's price line too.
- The grid goes before the last H2 when no section links the products.
- Tests for the writer's grid, getProductsForBlock and the toolbar's
Products button. Docs: Insert › Products in the Content Editor guide.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e price is read from Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rules-check # Conflicts: # web/src/lib/actions/shopping-path.ts
…, its removed products and Brief's changes (shopping path part 6 review) - getShoppingCheck reads products, variants and Merchant Center issues in 100-id chunks, paged past 1,000 rows, with the brand taken from the draft. Stock is read by variantStock, contexts normalised as the server's. - Products removed or left out of the path are checked too, when they can't be sold. They count for shopLinksLive only, and its words say to remove or replace the link on the page. - Brief's Shopping path tells the editor when it changes, so the check reads again. - One link collector (PageRead.links) for Rules and Before you publish, HTML blocks included, so the product grid counts in both. - shopProductLinks counts only products that can be sold. - A failed read shows as failed, and a re-read keeps the last result. - Before you publish: - shows reading and failed rows, and "N of M products linked"; - the bad list is capped with "+N more", as Rules names the products. - shopLinksLive alone gets its own not-for-agent message. - Relative links resolve against the page's address or the brand's domain. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…after each catalog sync, as the editor's Rules now do
Part 6's review widened the editor's link check. The daily check after
a catalog sync (lib/shopping-check.js) now reads a page the same way:
- a product the person removed from the path, or the path left out, is
checked too. It counts, at the catalog's page for it, only when it no
longer sells: the page may still link it;
- "products" and "products linked" count the path's products that sell;
- a draft's relative link ("/products/x") is read against its page,
else the brand's primary site;
- catalog variants are read by the brand too.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ducts no longer for sale, and close it once fixed (shopping path, part 7b) The mockup's "Action Center · a task the daily catalog check made". After each catalog sync the shopping check reads every published page with a shopping path again. A live page that links a product that is sold out, refused by Merchant Center or gone from the catalog gets a Fix action (lib/action-center/from-shopping-check.js, kind 'shopping_links'): - one per page (dedup key shopping_links:<draftId>), named after the page: "Best rain jackets for 2026: 2 products are sold out"; - one task, "Swap the 2 products that no longer sell", with the page, why, the steps, the path's in-stock products to link instead and its Done when: "The page links no product that is sold out, refused or gone. Checked automatically after the next catalog sync." It carries no change text, so AC-010's nightly page sweep leaves it to this check; - impact high from three products, scored as a sure, quick fix. The same check closes it: once the live page links none of them, its task and the action are completed, each with a History line. Work someone added to it stays open, and so does the action. A page whose action was dismissed isn't raised again for the same products; one closed while they still don't sell waits 7 days. At most 5 new actions a check, the rest at the next sync. Only a live page read now counts: a draft isn't what readers see, and a page that couldn't be read says nothing. A failure is logged and the check goes on. The drawer shows the page with "Swap in the editor", the products that no longer sell and why, and the ones to link instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rules-check Co-Authored-By: Claude Opus 5.5 <[email protected]>
…h-check # Conflicts: # web/messages/en.json # web/src/app/[locale]/(dashboard)/dashboard/content/library/page.tsx
… Library lists its drafts before 00352 is applied Co-Authored-By: Claude Opus 5.5 <[email protected]>
…page, name removed products, and skip ended plans A live page is read only on the brand's site and with words enough to be the page; one that links none of the path while its draft does is read from its draft. A removed product is named by its catalog title, and a brand whose workspace's plan ended isn't checked (ansvisor#1608). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s-action # Conflicts: # server/src/lib/shopping-check.js # server/src/lib/shopping-check.test.js
…lose it as checked automatically Check now on the task runs the catalog sync's shopping check on its one draft (checkShoppingDraft) instead of answering not_checkable; a draft with no path left says so. The check completes the task with its last check kept and writes AC-010's task_checked line to the History, as the other automatic checks do. The nightly page sweep leaves these tasks to the catalog sync. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ions come from Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s-action Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 of 12 tasks
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
6 of 12 tasks
…d test its live-page deadline and draft cap Skip a link longer than 2,048 characters when a page's links are read. Test the 3-minute live-page deadline, and that no row is dropped when a run stops at its most drafts.
…still links the products it names The check now counts an open action's products on its page even when a rebuilt shopping path dropped them, only while they still don't sell, so a sync or Check now closes the action only once the page links none of them. When the open action can't be read, its action isn't synced.
Contributor
|
I took the review's before-merge item over (5ff8b9f, on top of #1615's fix): the open action's |
This was referenced Oct 28, 2026
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
E-commerce Shopping path, part 7b of 7: a Fix action for a live page that links products no longer for sale, closed by itself once the page is fixed.
Stacked on #1615 (part 7a). This PR's own change is its commits after 7a's: 0339b5d, e1f5e13 and 9df9def (the pre-push review's fixes and docs).
When an action opens (
server/src/lib/action-center/from-shopping-check.js):shopping_linksaction, deduplicated asshopping_links:<draftId>.check: 'auto'.priority.js).When it closes:
task_checkedevent: "Checked automatically and done: {title}". The task keeps its last check.Check now on the task runs that page's shopping check at once (
checkShoppingDraft, throughrunTaskCheckfordetails.source === 'shopping_check'):links_not_for_saleno_answerno_shopping_pathThe nightly task sweep (#1565) leaves these tasks to the catalog sync.
Web:
Docs:
action-center.mdx's "Where actions come from" lists the product catalog.Related issue
Part of the e-commerce shopping journey. Follows #1615.
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
cd server && npx vitest run src/lib/action-center/from-shopping-check.test.js src/lib/action-center/task-checks.test.js src/lib/shopping-check.test.jscd web && yarn vitest run src/components/action-center src/lib/action-centerChecked in the browser at 1024 px against the dev DB: Action Center loads with its actions. The dev catalog is empty, so no shopping action was made; the logic is covered by the tests.
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Checks run at the top of the stack (7c): server 3,391 tests, web 4,368 tests + build (see #1615 for the two load-only failures that pass alone).
For you, @gkhngyk:
actionCenter.actionTexts, the registry'sACTION_KINDS, display'sPERSON_SENT_KINDSand display.test's count. This takes it to 70; with PV-7, 72.docs/guides/action-center.mdxwasn't Prettier-clean before this PR. Only the new row is added, so unrelated lines aren't reformatted.🤖 Generated with Claude Code