Skip to content

fix(mentions): take Copy summary's Total mentions change on the same prompts as its card - #1628

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/mentions-change-same-prompts
Oct 28, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/mentions-change-same-prompts

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Since #1230 the Mentions page takes every change on the prompts both windows answered, as Insights does. So adding or removing prompts doesn't read as a rise or a fall. Copy summary still took the Total mentions change on all of each window's responses. The copied text could say +30% under a card that said +10%.

It now takes it on the same basis (changeBasis) as the card. The summary's other lines carry no change.

Related issue

None. Ansvisor asked that the Insights and Mentions changes agree on the right basis: the prompts both windows answered (#1226, #1230).

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

cd web && yarn vitest run "src/app/[locale]/(dashboard)/dashboard/mentions"

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

Checked together with the other PRs from the same test (one integration tree of all eleven on main 3f6a4d4):

  • server/: npm run format, npm run lint and npm test (3,349 tests).
  • web/: yarn format, yarn lint (0 errors, the 7 earlier warnings), yarn typecheck, yarn test (4,385 tests) and yarn build.
  • This branch's own tests were also run on it alone.

🤖 Generated with Claude Code

…prompts as its card

Since ansvisor#1230 the Mentions page takes every change on the prompts both
windows answered, as Insights does, so adding or removing prompts doesn't
read as a rise or a fall. Copy summary still took the Total mentions change
on all of each window's responses: the copied text could say +30% under a
card that said +10%.

It now takes it on the same basis (changeBasis), as the card does. The
other lines of the summary carry no change.

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

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

Looks good.

What I checked:

  • Same basis as the card. summaryText now takes changeBasis(overview), which is what OverviewKpis uses for Total mentions: relativeChange(base.occurrences, prev.occurrences), rounded to a whole percent. When there's no same (before 00195), it falls back to all of each window, as the card does. The value on the line is still the whole window's cur.occurrences, the same as the card's.
  • The rest of the summary. The headline sentences already go through changeBasis (mentions-headline.ts), and so does the MCP tool (mcp/mentions.ts). The other KPI lines carry no change. Nothing else in the export computes one.
  • Tests. The mentions folder's 5 test files pass (51 tests). With main's _use-mentions-export.ts under the same tests, the new test fails (+30% instead of +10%).
  • Merge. Clean on main 3f6a4d4.

Before the API deploy: web only. Nothing depends on the API.

@gkhngyk
gkhngyk merged commit 00bba98 into ansvisor:main Oct 28, 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