Skip to content

fix(content): say both what to check in the feed and which product links to change when both rules are open - #1654

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/agent-message-both-rules
Oct 28, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/agent-message-both-rules

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Follow-up from #1610 (item 3). The Content Editor's Run Agent note and its toast now cover both open rules when the page has both of these:

  • "Price, GTIN and stock match the feed";
  • the shopping links rule (links to products that no longer sell).

Before, the note only gave the feed rule's message, so the product links to change went unmentioned. notForAgentMessage now returns a new message, notForAgentFeedShopping, that says both:

Content Agent doesn't change a price, GTIN or stock, or which products the page links: check which is right, the page or your product feed, and fix that one; then remove or replace the links to products that are out of stock, refused or gone.

The message about extra H1s still comes first.

A new test checks that every answer notForAgentMessage can give has a message in en.json.

(The commit message calls the feed rule "Matches your product feed"; its real name is "Price, GTIN and stock match the feed".)

Where people see it: Content Editor › Rules tab, the note above Run Agent and the toast after it, on a shop draft with both rules open.

Related issue

Follow-up from #1610's review.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. cd web && npx vitest run src/lib/content/rules.test.ts
  2. On a shop draft whose feed check and shopping links check both fail, open Rules: the note and the toast name both.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Full checks were run in one tree with this batch's six follow-up branches merged:

  • web: 4,347 tests passed, plus typecheck, lint (0 errors) and build;
  • server: 3,347 tests passed, and three load-timeout files passed alone.

🤖 Generated with Claude Code

…nks to change when both rules are open

Follow-up from ansvisor#1610 (item 3). With "Matches your product feed" and the
shopping links rule both open, Run Agent's note (and its toast) gave only
the feed's message, so the links to products that no longer sell went
unmentioned. notForAgentMessage now answers notForAgentFeedShopping then,
one message that says both; the extra H1s' message still comes first.

A test checks that each of its answers has a message in the editor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@gkhngyk gkhngyk 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.

Looks good.

What I checked:

  • Own change. 6f354b2 on main (3f6a4d4): rules.ts, its test and one en.json key. It merges cleanly on main and with #1653, #1662, #1663 and #1664. en.json merges on its own with #1662's change two lines below.
  • The answers. notForAgentMessage still gives the H1 message first, the feed message with only feedMatch open, and the shopping message with only shopLinksLive open. With both open it now gives notForAgentFeedShopping, which says both what to check in the feed and which links to change. No other rule in NOT_FOR_AGENT is left without a message.
  • Tests. rules.test.ts passes on this head. With main's rules.ts put back, both the changed test and the new one fail. With main's en.json put back, the new "has a message for each answer" test fails, so a missing key is caught too.
  • With #1662 merged as well, the four agent messages all describe a product that doesn't sell as "out of stock", and the rule is named "No out-of-stock or refused product linked", so they read the same way.

Before the API deploy: web only. It works on merge.

@gkhngyk
gkhngyk merged commit 47c9023 into ansvisor:main Oct 28, 2026
6 checks passed
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.

2 participants