Repository navigation
feat(citations): per-URL detail page — cited-in answers, prompt breakdown, owned-URL bridges - #556
Merged
Merged
Conversation
…eakdown and owned-URL bridges (#535)
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
Implements #535: every cited URL now has its own detail page at
/dashboard/citations/url?u=<encoded-url>, answering "what exactly is citing this page, for which prompts, and is it working for us?" on one screen.New server action —
getCitationUrlDetailinweb/src/lib/actions/citations.ts: one URL-filtered pass overprompt_resultsusing the samescanFilteredResultsscan, filters and URL bucketing as the overview (the inline URL normalization was extracted into a sharednormalizeCitationUrlhelper so the two can never drift), plus, for brand-owned URLs, two bridge queries: prompts targeting the URL viaprompt_target_urls(matched with the same loose host+path key as the cited-stats pipeline) and AI-referred visits fromai_traffic_logs. No schema change, no new RPC.New page — header (favicon, title, clickable URL, category + article-type badges, add-as-competitor for third-party domains / "Owned" badge for brand domains), KPI strip (total citations, answers citing, distinct prompts, platforms, first/last seen), the shared citations filter bar (date/platform/region), a paginated (10/page) "Cited in" list — date, platform icon, prompt link, sentiment, brand-mentioned, and the citation's position in the answer ("Early · #2 of 7", ranked by the stored start index) — a prompts breakdown table, and the two owned-URL bridge cards.
Shared components extracted (used by both the overview and the new page, no behavior change):
components/citations/filter-bar.tsx— the filter bar,CitationsUIFilters, date-range resolution, platform-option grouping, andbuildCitationDetailHref(carries the active filters into the detail link).components/citations/add-competitor-button.tsx— the feat(citations): inline "+" to add a cited domain as a competitor from the Domains table #301 dialog, now with anappearanceprop (icon row-button vs labeled header button).Entry points — URL rows on the Citations page (carrying the current filters) and the prompt detail Top Sources URLs tab both link to the detail page; the external-site link stays available as a small icon next to the title.
Related issue
Closes #535
Type of change
feat— New featureHow to test
Checklist
feature/,fix/,chore/,docs/)yarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)