Repository navigation
Description
Problem
The Citations page lets users hide their own domain from the list (Exclude own domain) and show only competitors (Competitors only), but there's no way to isolate just their own domain — to answer the very common AEO question "which of my pages are AI engines actually citing?".
Today's two filters at web/src/app/[locale]/(dashboard)/dashboard/citations/page.tsx:586-610:
| Filter | Behavior |
|---|---|
Exclude own domain |
Hides rows where category = you |
Competitors only |
Shows only rows where category = competitor |
SOURCE_CATEGORIES in web/src/lib/citations/classify.ts already includes a you bucket — citations to the user's tracked domain — and the aggregation in web/src/lib/actions/citations.ts:241 already discriminates on that category. The data is there; the UI just has no toggle that says "give me only my own".
Proposed change
Add a third filter button Own domain only alongside the existing two. It mirrors the existing pattern:
- New field
ownOnly?: booleanonCitationsFiltersinweb/src/lib/actions/citations.ts. - In the aggregation loop, when
ownOnly === true, skip rows wherecategory !== 'you'. - A new toggle button in the filter bar (around line 596) with the same
variant/size/classNameshape as the other two. - The three buttons are mutually exclusive: turning
Own domain onlyon resetsexcludeOwnDomainandcompetitorOnly(they can't coexist semantically — "exclude own" while "show only own" is nonsensical). The same already happens between the existing two (line 604).
Acceptance criteria
- New
Own domain onlybutton appears in the citations filter bar, sitting next to the existing two - Toggling it ON filters the list (and the source-type/domain/URL panels) to only category =
yourows - Toggling it ON also turns OFF the other two filters when they're set, so the three behave mutually exclusively
- The KPI tiles and the Source Types pie chart respond to the filter the same way they do for the existing toggles
-
pnpm tsc --noEmit+yarn lintclean - No regression on the existing two toggles
Out of scope
- Refactoring the three buttons into a single segmented control (cleaner UX but a bigger change — leave for a follow-up if anyone wants to pick it up)
- Adding the same filter to the MCP
list_citationstool input schema (currently only the page exposes these toggles; adding them at the data layer is a separate enhancement) - Translation copy beyond English — Citations page already only uses English strings inline; matching the convention is fine.
Notes
The existing two toggles are a good template — the implementation should look almost identical, just with a new button and one extra check in the aggregator. Pair with the in-file roleLabel pattern for any user-facing copy you add.
Activity
Pallavikumarimdb commentedon Jun 2, 2026
@gkhngyk Can I work on this?
gkhngyk commentedon Jun 2, 2026
All yours @Pallavikumarimdb, assigning to you. Thanks for picking up another one.
The existing two toggles in the same component are exactly the template — copy the
Exclude own domain/Competitors onlybutton shape atweb/src/app/[locale]/(dashboard)/dashboard/citations/page.tsx:586-610and add a third for "Own domain only". The matching filter check goes in the aggregation loop atweb/src/lib/actions/citations.ts:241right next to the existingcategory === 'you'check. Three buttons should be mutually exclusive — flip the other two off when "Own only" turns on.No rush — whenever you wrap #148 (just the
yarn formatpush), pick this up next. PR withCloses #149.