Skip to content

feat(mentions): mark your brand in ink instead of violet - #1220

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:feature/mentions-brand-highlight
Oct 20, 2026
Merged

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

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

The Mentions page marks your brand in ink instead of violet, as the charts now do (#1217).

Where Before Now
Your brand's highlight (MARK_CLASS.brand), in the Mentions table's context column, the drawer's quote and the full answer violet bg-primary text-primary-foreground: a black mark with white text on light, a light mark with dark text on dark
The drawer's mention quote border border-violet-400 border-primary
The You source badge in the drawer's citations violet border-primary/30 bg-primary/10 text-foreground

Competitors keep their grey outlined mark, so the two stay easy to tell apart.

The test that checks the brand mark's class now expects bg-primary. Two files plus that one test line; colors only.

Related issue

None. A user request (the Mentions violet highlights in the brand's colors, after the chart colors in #1217).

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. Open /dashboard/mentions?tab=mentions. In the Mention context column, your brand is a black mark and competitors grey outlined.
  2. Click a row. In the drawer, check:
    • the quote's left border is ink;
    • the "Your brand" legend matches the mark;
    • the full answer's marks match too.
  3. Repeat in dark mode: the brand mark turns light.

I checked this locally in light and dark themes.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Also run: yarn test (1,694 pass) and yarn build (with the CI placeholders).

🤖 Generated with Claude Code

Your brand's highlight in the Mentions table and the answer, the mention quote's border and the You source badge used violet. They now use the theme's primary (ink: black on light, near-white on dark), as the Mentions and AI Traffic charts do; competitors keep their grey outlined mark.

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

Copy link
Copy Markdown
Collaborator Author

@gkhngyk Follows #1217: the Mentions brand highlight, the quote border and the You badge move from violet to the theme's primary (ink). Competitors keep their grey outlined mark. Two files plus one test line, checked in both themes. The violet/indigo badges elsewhere (Citations' You/Social, Action Center's Compete/In progress) are untouched; say if you want those in the same style.

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

Checked on main: web tests pass. bg-primary with text-primary-foreground keeps the mark readable in both themes, and competitors keep their grey outline.

@gkhngyk
gkhngyk merged commit 849ea02 into ansvisor:main Oct 20, 2026
6 checks passed
gkhngyk pushed a commit that referenced this pull request Oct 20, 2026
The Similar Topics card on the Prompts page's Insights view drew its
bars in indigo, one of the last violet-blue accents after #1217, #1220
and #1221 moved the charts and badges to the brand's colors. They now
use bg-foreground/60, the gray the Mentions and Insights share bars
already use: dark gray on light, light gray on dark.

Co-authored-by: Cihan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@gkhngyk gkhngyk mentioned this pull request Oct 21, 2026
8 of 12 tasks
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 21, 2026
…he shares are of responses naming a brand

- The radar draws the brand in ink (var(--primary)), as the rest of the
  Mentions page does since ansvisor#1217/ansvisor#1220, and the competitors in orange,
  teal and red (no violet); insights-trend keeps its palette to itself.
- The brand × attribute cells take a neutral tint instead of indigo.
- The shares are over the responses that name a brand, so the labels say
  "of responses naming …" rather than "of mentions", which on this page
  counts every time a brand is named.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk added a commit that referenced this pull request Oct 21, 2026
* feat(mentions): add the per-answer terms and the Perception read

The Perception tab's data (MS-09), deterministic as spec §9 asks for V1:

- migration 00161: mention_terms() takes the sentences of an answer that
  name an entity and returns their words and two-word phrases, minus stop
  words in 13 languages (Snowball dictionaries), words answers use about
  every brand alike, every brand's names and the question's own words;
  mentions_answer_terms keeps the distinct terms per answer and entity
  named (the brand or a competitor), filled by refresh_mentions_daily with
  the mention rollups; mentions_perception() reads a window and the one
  before: the brand's top terms with their trend, the 8 attributes that
  tell it and its four most mentioned competitors apart with each one's
  share of mentions, and the competitors named in the same answers
- the mention history refreshes three days a call: the terms make each
  call heavier than the citation rollups' fortnight
- web: getMentionsPerception, the parsed shape, shares, and the biggest
  gap (a competitor leading an attribute by 20+ points)

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

* perf(mentions): refresh the answer terms in their own function

Reading the answers' text for their terms takes about 2.4 ms per answer
and entity named: about 7 s for a recent day of the largest brand, and
more on its busier days. Inside refresh_mentions_daily that also ran in a
sentiment correction (00160), within the person's 8 s request, where the
terms never change.

refresh_mention_terms now holds that part, and refresh_mentions_daily
stays as 00157 wrote it. The server calls both for a completed run, the
nightly sweep and the backfill; the backfill goes a day at a time.

Claude-Session: https://claude.ai/code/session_0121amRjX7UFrgmGELAtkc7A

* fix(mentions): lock the terms refresh per brand, and refresh terms a day at a time

- refresh_mention_terms takes a per-brand advisory lock of its own, as
  refresh_mentions_daily does since 00192: a run's refresh and the nightly
  sweep can cover the same days, and the second insert would fail on the
  (result_id, entity) key.
- refreshMentionsDaily refreshes the rollups for the range in one call and
  the terms one day per call, so the sweep's three days stay well inside
  the service role's statement timeout.

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

* feat(mentions): show the Perception tab

The Mentions & Sentiment Perception tab (MS-09) reads mentions_perception
and shows what AI associates with the brand, a radar of the brand against
its three most mentioned competitors, the brand x attribute heat map, the
competitors named beside it and the biggest gap. The gap leaves out shares
taken over fewer than 20 mentions, as the Overview does, and only names a
brand the radar draws.

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

* fix(mentions): draw the brand in ink on the Perception tab, and say the shares are of responses naming a brand

- The radar draws the brand in ink (var(--primary)), as the rest of the
  Mentions page does since #1217/#1220, and the competitors in orange,
  teal and red (no violet); insights-trend keeps its palette to itself.
- The brand × attribute cells take a neutral tint instead of indigo.
- The shares are over the responses that name a brand, so the labels say
  "of responses naming …" rather than "of mentions", which on this page
  counts every time a brand is named.

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

---------

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