-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add more details to NPS score [part 2] #29112
feat: add more details to NPS score [part 2] #29112
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR enhances the NPS (Net Promoter Score) visualization in survey results by adding a detailed breakdown view.
- Added new reusable
StackedBar
component in/frontend/src/scenes/surveys/surveyViewViz.tsx
for consistent bar chart visualization - Implemented
NPSStackedBar
component to display percentage breakdown of promoters, passives, and detractors - Added tooltip in survey view explaining NPS score calculation methodology
- Refactored
UsersStackedBar
to leverage the newStackedBar
component for consistency - Enhanced survey results view with color-coded segments showing relative proportions of each NPS category
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
{/* eslint-disable-next-line react/forbid-dom-props */} | ||
<div className="w-3 h-3 rounded-full mr-2" style={style} /> | ||
<div key={`stacked-bar-legend-${label}`} className="flex items-center mr-6"> | ||
{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Empty JSX fragment {} can be removed
{} |
4ec9698
to
8ba698a
Compare
Size Change: 0 B Total Size: 9.72 MB ℹ️ View Unchanged
|
Nice, cool stuff. |
Problem
currently, our NPS score view is limited, because while it shows the score, it doesn't show the % of detractors, passive or promoters.
Changes
before:
after:
adds a new StackBar reusable component, now used for both NPS Breakdown and Survey Stats.
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
yes
How did you test this code?
unit tests on the previews PR