Skip to content

fix(content): show the brand's cited pages as an Overview, not an overlap warning - #1320

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/content-overview
Oct 22, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/content-overview

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

The user's product call, from reviewing the live Plan: more of the brand's pages cited for the same prompts is no loss. We can't control it, and the more citations and mentions, the better: AI answers aren't Google rankings. So neither Start nor the Plan treats it as a problem any more.

Start (New content → Start):

  • "Overlap check" is now "Overview": a plain box (no amber, no warning icon) with "N of your pages are cited for these prompts" and the same table of pages. With none, it says "None of your pages is cited for these prompts yet", without "Safe to create".

  • The action the person clicked stays chosen. Pressing Create used to switch Start to "Optimize X instead" whenever a page answered half the prompts, so Create almost always opened as Optimize. Start no longer picks for the person, and nothing is labelled "Recommended".

  • The choices (overlapOptions):

    • the page the Content plan named, when there is one;
    • "Create a new page" ("Another page of yours for AI to cite");
    • "Optimize /page instead", for the page cited for most of the prompts, when it is another.

    With a new page as the only choice, no radio group shows.

Plan:

  • The red Overlaps card is gone; the cards are Create, Optimize and Protect.
  • The ⚠ Overlap tag on rows is gone.
  • Rows that were listed only because another of the brand's pages is cited for the same prompts are gone, including the "top page past the five protected" overlap row.
  • "Ranked by impact · overlaps checked" now reads "Ranked by impact".

content_plan_pages (00220 / 00221) still returns overlaps; the Plan no longer reads it. Dropping it from the function, and the work it does, can be a follow-up migration if you'd like the read lighter.

Related issue

None. Product feedback from the user.

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. Content → Plan: three cards, and no "⚠ Overlap" on any row.
  2. Library → New content → Create from scratch: pick an opportunity whose prompts cite your pages → Continue.
    • "Overview" lists them, with no warning.
    • "Create a new page" stays chosen.
    • "Optimize /page instead" is offered, not recommended.
  3. Plan → Optimize on an opportunity row with a page: the plan's page is chosen, with "Create a new page" and the page cited most beside it.

Checked in light and dark, at 1024 px and wider.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/): no errors; the 6 warnings are in files this PR does not touch
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR (overlap as information, not a warning)

Also run: yarn test (2,478 tests; overlapOptions, the Overview in Start, and the Plan's three cards and rows are covered) and yarn build. Web only, no migration. It touches the Plan page and its test like #1319, on different lines; whichever merges second takes main.

🤖 Generated with Claude Code

…rlap warning

More of the brand's pages cited for the same prompts is no loss (AI
answers aren't a ranking), so neither Start nor the Plan treats it as a
problem any more:

- Start's "Overlap check" is an "Overview": a plain box listing the
  brand's pages AI already cites for these prompts, with no amber warning,
  no "Safe to create" and no "Recommended". The action the person clicked
  stays chosen (Create stays Create); the choices are the plan's page when
  it named one, a new page, and optimizing the page cited most.
- The Plan drops the Overlaps card, the ⚠ Overlap tag on rows, and the
  rows that were listed only because another page of the brand is cited
  for the same prompts.

content_plan_pages (00220/00221) still returns overlaps; the Plan no
longer reads it.

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

Copy link
Copy Markdown
Collaborator Author

@gkhngyk A product change from the user's review of the live Plan: the brand's own pages cited for the same prompts are information, not a warning. So Start's "Overlap check" becomes an "Overview" with no warning and no recommendation, and the clicked action stays chosen. The Plan drops the Overlaps card, the ⚠ tag and the overlap-only rows. content_plan_pages still computes overlaps, which is now unread. Say if you'd like a follow-up migration that drops it.

@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. One follow-up worth doing in this PR or right after it:

  1. content_plan_pages still computes overlaps (supabase/migrations/00226_content_reads_bounded.sql:481-513, the cur_answers / page_prompts / competing / page_overlaps CTEs, used at :569 and :575). After this PR nothing reads it (web/src/lib/actions/content-plan.ts:99 no longer maps it), and it is the only part of the function that reads prompt_results and prompt_result_citations row by row. Timed on the largest brand as authenticated: with a cold cache the 30-day call took 8.7 s and 9.5 s in two runs, which is over the 8 s statement timeout. With a warm cache it took 0.5 s. A copy without those four CTEs ran in 0.7 s (30 days) and 1.1 s (90 days) in the same session. Add a migration that drops the four CTEs and the overlaps key. Use create or replace with the same signature, so the grants carry over.

Tested on top of main together with #1327, #1319, #1330 and #1320: web 2,487 tests, server 2,006, tsc, lint and Prettier pass.

@gkhngyk
gkhngyk merged commit 8da6780 into ansvisor:main Oct 22, 2026
6 checks passed
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 22, 2026
… opens Start to optimize

The merge of main took ansvisor#1320's side and dropped this PR's preferOptimize,
so Optimize content from the Improve tab without a cited page opened Start
on a new page. The person picked Optimize: once the Overview's read lands,
its first page to optimize is chosen, a single time. A pick of their own,
or a retry, leaves the choice to them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk pushed a commit that referenced this pull request Oct 22, 2026
* feat(prompts): open the Content Editor from a tracked prompt

From the user's spec, PR A of the Content Editor entry points:

- The Tracked Prompts row menu gets "Create content", which opens New
  content > Start with the prompt picked. When a draft not yet
  published already covers the prompt (content_drafts.prompt_ids), it
  shows "Open draft" and goes to the editor instead.
- The Positions panel's Improve tab starts with a content step, on the
  user's thresholds (lib/prompt-content.ts). If no answer in the period
  mentions or cites the brand, it offers Create content. If the brand is
  mentioned in under 20% of 5+ answers, or at an average position worse
  than 3 over 3+ answers, it offers Optimize content on the brand page AI
  cites most for the prompt (new citedPage in the positions data).
  Without a cited page, Start's overlap check offers the pages to
  optimize.
- Start takes a "prompt" preset. The cited page's option reads "The page
  AI engines cite for this prompt". The panel stays open when Escape or
  a click outside closes Start over it.

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

* fix(prompts): look for the prompt's draft again after Start sends one, so Improve offers Open draft

Start sent to the Agent or the Team closes over the positions panel, which
stays open. The Prompts page now bumps a counter on New content's onSent,
passed through the sheet to PromptContentStep, whose draft lookup reruns
on it: the step offers Open draft rather than a second draft.

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

* fix(content): pick the Overview's page to optimize once when a prompt opens Start to optimize

The merge of main took #1320's side and dropped this PR's preferOptimize,
so Optimize content from the Improve tab without a cited page opened Start
on a new page. The person picked Optimize: once the Overview's read lands,
its first page to optimize is chosen, a single time. A pick of their own,
or a retry, leaves the choice to them.

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

---------

Co-authored-by: Cihan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
gkhngyk pushed a commit that referenced this pull request Nov 6, 2026
…2188)

Pages of the brand cited for the same prompts aren't a problem, so the
words for them don't say "overlap" (2026-10-21 decision, kept for the
Plan and Start in #1320). The Impact tab's line under "Your other pages
for these prompts" now reads "The only page of yours cited for its
prompts", with no "· no overlap". Text and its test only.

Co-authored-by: Cihan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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