Skip to content

feat(mentions): add the Mentions sidebar item and the Mentions & Sentiment page shell - #1114

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:feature/mentions-shell
Oct 17, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:feature/mentions-shell

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

First of six PRs for Mentions & Sentiment, following the product spec and mockup (MENTIONS-spec.md, MENTIONS-mockup.html). This one adds the sidebar item and the page shell (MS-05).

Merge with the next two. The tabs show a placeholder ("This view is on its way…") until the data layer (PR 2) and the Overview (PR 3) land, so please ship these together.

What changes

  • Sidebar (config/dashboard.ts): Mentions, with a "New" pill and a speech-bubble icon, directly above Citations, its sibling concept ("who does AI talk about?" next to "which sources does AI use?").
  • Page /dashboard/mentions:
    • Header: title "Mentions & Sentiment" and the mockup's description.
    • Tabs: Overview · Mentions · Perception, the V1 tabs. Sentiment (V1.5) and Fact-check (V2) stay hidden until built.
    • Filter bar (mentions/_filter-bar.tsx), shared by every tab. It sits below the tabs, as the spec orders it: section first, then filters, then content.
      • Date range: 24h / 7d / 30d / 90d / Custom, opening on 30 days as in the mockup. It uses the Prompts page's presets and resolver.
      • Platform: the tracked AI platforms.
      • Country: shown when the brand tracks more than one.
      • Topic.
      • Search over prompts, brands and phrases.
    • Tab and filters live in the URL (lib/mentions-filters.ts, e.g. ?tab=mentions&range=7d&q=integrations), so a refresh or a shared link restores the view. Defaults are left out of the URL.
  • Copy: en.json: nav.mentions, and a new mentions namespace.

The plan (agreed with product)

  1. This PR: sidebar and page shell.
  2. Data layer: a daily mention rollup (migration), a backfill of stored answers, a refresh after each run, and the query functions. It is built from what tracking already stores (mention_count, mention_position, competitor_mentions, sentiment), so no new LLM call.
  3. Overview: template headline, KPIs, trend, by AI platform, competitor framing.
  4. The Mentions table and the Response drawer.
  5. Perception: associated terms, brand × attribute, frequently mentioned with.
  6. Export CSV, Copy summary, API and MCP.

V1 decisions:

  • Competitor framing shows sentiment for your brand only; competitor sentiment comes with the V1.5 classifier.
  • Brand aliases come later, in their own PR.

Related issue

None.

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. The sidebar shows Mentions · New directly above Citations.
  2. Open it: the page title, the three tabs and the filter bar are there.
  3. Switch the tab, the range and a filter, and type a search: the URL follows. Reload: the same view comes back.
  4. Narrow the window to 1024px: the filters wrap.

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 7 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

Also run:

  • web: yarn test (859) and yarn build pass.
  • Tests:
    • lib/mentions-filters.test.ts: defaults; reading a shared link; unknown values falling back; custom dates only for a custom range; a clean URL by default; the round trip.
    • lib/dashboard-navigation.test.ts: Mentions sits directly above Citations and carries the New pill.
  • In the browser, on a production build: the sidebar, the tabs, the filters and the URL round trip after a reload, checked at 1440px and 1024px, in the light and dark themes.

🤖 Generated with Claude Code

…iment page shell

Mentions & Sentiment (MS-05) gets its sidebar item, "Mentions" with a New
pill and a speech-bubble icon, directly above Citations, its sibling
concept. Once Topics moves into Prompts, it sits between Prompts and
Citations.

/dashboard/mentions has the page's title and description, its V1 tabs
(Overview, Mentions, Perception; Sentiment and Fact-check stay hidden until
built) and the filter bar every tab shares: date range (30 days by default,
as in the mockup), AI platform, country, topic and a search over prompts,
brands and phrases. Tab and filters live in the URL, so a refresh or a
shared link restores the view. The tabs' figures and charts arrive with the
next PRs.

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

Copy link
Copy Markdown
Collaborator Author

@gkhngyk this is ready for review: the first of six PRs for Mentions & Sentiment (spec MENTIONS-spec.md) — the sidebar item and the page shell with its tabs and URL filters. The tabs' content arrives with the next two PRs (data layer, Overview), so please ship them together. It has one trivial conflict with #1107 in config/dashboard.ts (keep Mentions, drop Topics).

@gkhngyk
gkhngyk merged commit f963d51 into ansvisor:main Oct 17, 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