You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(topics): KPI card shows a bare "0pts" delta when the change is 0 #360
On the topic detail page (/dashboard/topics/[id]), the KPI cards at the top show a small change/delta next to the value. When the delta is exactly 0, the card renders a bare 0pts (e.g. the Positive sentiment card when it's at 0%). A zero change with no up/down arrow and no sign is meaningless noise — it should not be shown at all.
When change === 0: no arrow (both > 0 and < 0 are false), no + sign, and it prints 0 — plus pts for %-suffixed cards — so you get 0pts (or a bare 0 on the count cards). This affects all four cards (Avg visibility, Brand mentions, Citations, Positive sentiment), but it's most visible on Positive sentiment when the value is 0%.
Proposed change
Treat a zero delta the same as "no delta" — don't render the change span when change === 0:
That hides 0pts / 0 across all the KPI cards. (Alternative, if we'd rather still signal "no change": render a neutral — instead of the number — but hiding it is simpler and matches the ask.)
How to test
Open a topic whose Positive sentiment is 0% → the card shows just 0% with no 0pts delta next to it.
A non-zero change still renders normally (e.g. +5pts in green, -3pts in red, with the arrow).
The same holds for the other KPI cards when their change is 0 (no bare 0).
Notes
Small, self-contained UI change — good first issue.
The Insights and prompt detail pages have similar KPI-card delta logic; out of scope here, but worth a glance as a follow-up if the same 0 shows there.
Thanks @prakashiitp — assigned to you! 🎉 The fix is in the KpiCard component in topics/[id]/page.tsx: the delta renders whenever change !== null && change !== undefined, so a zero change prints a bare 0pts (or 0). Add && change !== 0 to that guard so a zero delta isn't shown. Non-zero deltas (e.g. +5pts / -3pts with the arrow) should still render as before. Ping here if anything's unclear.
Activity
prakashiitp commentedon Jul 7, 2026
Hi @gkhngyk, I'd like to work on this issue. Could you please assign it to me? Thanks!
gkhngyk commentedon Jul 7, 2026
Thanks @prakashiitp — assigned to you! 🎉 The fix is in the
KpiCardcomponent intopics/[id]/page.tsx: the delta renders wheneverchange !== null && change !== undefined, so a zero change prints a bare0pts(or0). Add&& change !== 0to that guard so a zero delta isn't shown. Non-zero deltas (e.g.+5pts/-3ptswith the arrow) should still render as before. Ping here if anything's unclear.