Repository navigation
feat(action-center): add a Positive Sentiment KPI - #1128
Merged
Merged
Conversation
The Action Center can track Positive Sentiment: the positive share of the AI responses naming the brand, the same figure as Insights' Positive sentiment card, with its change in points and a daily trend that leaves out days without a mention. It comes last in the KPI list, the Brand Monitoring template becomes Mentions + Positive Sentiment, and Mentions actions link to it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
@gkhngyk an Action Center KPI for Positive Sentiment (the Insights card's positive share), last in the KPI list; Brand Monitoring becomes Mentions + Positive Sentiment, and Mentions actions link to it. No migration. A follow-up PR will give brands without KPIs a ready-made set with +20% targets. |
8 of 12 tasks
gkhngyk
approved these changes
Oct 17, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Rebuilt on main: the KPI tests, typecheck, lint and format pass, and CI is green. The daily trend reads positive_count / mentioning_results from insights_aggregates_daily, the same ratio as the Insights card (checked on production: both fields are returned per day).
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
A Positive Sentiment KPI in the Action Center. It measures the positive share of the AI responses that name the brand: the same figure as Insights' Positive sentiment card, now trackable against a target like the other KPIs. It is the first of two PRs. The next one gives a brand with no KPIs a ready-made set with +20% targets, this KPI included.
KPI (
web/src/lib/kpis/registry.ts)positive_sentiment:percent,higher_is_better,source: 'tracking', default target 50. It files under the Mentions category, since sentiment is read over mentions.KPI_KEYS,DEFAULT_KPI_SET).Value (
web/src/lib/actions/kpis.ts)getInsightsSummary'spositiveSentimentPct. That summary is already read for Mentions and Citations, so the KPI adds no query when they share a window.sentimentChange, in points, as Insights shows it.insights_aggregates_dailyreads that feed Mentions and Citations (positive_count / mentioning_results). A day without an answer naming the brand is left out rather than drawn as 0%.Elsewhere
kpi-table.tsx: a Smile icon.en.json: the name and a short description. A longer first draft pushed the Status column out of view at 1024px.server/src/lib/action-center/from-mentions.js: Mentions actions (mention_review) listpositive_sentimentamong theirkpi_keys, so the action drawer's related KPIs include it.No migration:
kpi_definitions.kpi_keyis free text, and values are computed on read.Related issue
None.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/): no errors; the 7 warnings are in files this PR does not touchyarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run:
web:yarn test(1252) andyarn buildpass.lib/actions/kpis.test.tscovers:server:npm run lintandnpm test(1435) pass.from-mentions.test.jsexpects the new KPI key.Known, unchanged here:
BASKET_KPIS) doesn't measure positive sentiment before/after yet.🤖 Generated with Claude Code