Repository navigation
Description
Problem
Citation rows on /dashboard/citations are aggregates with a single action (add-as-competitor). There is no way to answer "what exactly is citing this page, for which prompts, and is it working for us?" without manually cross-referencing results. Each cited URL deserves a detail page — all the data already exists per result in prompt_results.citations (url, title and the citation's position in the answer) joined with platform/model/date/sentiment/prompt.
Scope (v1)
New page keyed by cited URL — URLs can't be path segments, so route as /dashboard/citations/url?u=<encoded-url> (or a short hash id). Everything below derives from a URL-filtered scan of prompt_results — no schema change, no new RPC; one server action.
- Header — favicon, page title, clickable URL, domain, source-category badge and article type. Context action on the right: add-as-competitor (existing dialog) for third-party domains, an "owned" badge when the domain belongs to the brand.
- KPI strip — total citations, answers citing, distinct prompts triggering, platforms, first/last seen. Reuse the citations page filter bar (date/platform/model/region), same-denominator rules as everywhere else.
- Cited-in list — every answer citing this URL: date, platform/model, prompt text (linking to the prompt detail page), that answer's sentiment, whether the brand was mentioned in the same answer, and the citation's position in the answer (early/late — from the stored start index). Paginated 10 per page.
- Prompts breakdown — which prompts trigger this citation, grouped with counts: the queries this page is winning.
- Owned-URL bridges — when the URL is on the brand's own domain: (a) "targeted in N prompts" from
prompt_target_urls, linking into the prompt workflow; (b) AI-referred visits to this page from the traffic data. Closes the citation → targeting → traffic loop on one page.
Entry points: citation URL rows on /dashboard/citations and the Top Sources URLs tab on the prompt detail page link here.
Out of scope (v2 follow-up)
- Citation trend over time (mini chart)
- Co-citations — sources most often cited in the same answers as this URL
- Domain-level detail page (same structure aggregated per domain, with its URL list)
Acceptance criteria
- Opening a citation from either entry point lands on the detail page with the same filters applied.
- Counts on the detail page agree with the citations overview for the same URL, window and filters.
- The cited-in list pages 10 at a time; prompt links navigate to the prompt detail page.
- Owned-URL sections render only for brand-domain URLs.
yarn lint,yarn typecheck,yarn format:checkpass fromweb/.
Activity
feat(citations): per-URL detail page with cited-in answers, prompt br…