Skip to content

feat: improvements for survey stats #30787

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

Merged
merged 15 commits into from
Apr 8, 2025

Conversation

lucasheriques
Copy link
Contributor

@lucasheriques lucasheriques commented Apr 4, 2025

Problem

right now, we only show responses filtered by user distinct ids. since it's possible on some scenarios a survey is displayed twice, this doesn't track the total number of responses.

Also a chance to improve our loading screens, adding proper skeletons instead of just a random line, and also add the conversion rate for each user.

Changes

Before After
CleanShot 2025-04-03 at 21 26 37@2x CleanShot 2025-04-07 at 15 09 09@2x
  • Displaying conversion rate
  • Display total number of responses (not filtered by distinct users)
  • UX improvements

👉 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?

visual changes only

@lucasheriques lucasheriques requested a review from a team April 4, 2025 00:27
@lucasheriques lucasheriques self-assigned this Apr 4, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 improves survey stats display and filtering by introducing a new stats component with enhanced loading skeletons, conversion rates, and refined user count logic.

  • frontend/src/scenes/surveys/SurveyResponseFilters.tsx: Updated header tag for improved accessibility.
  • frontend/src/scenes/surveys/SurveyStatsSummary.tsx: New component adds proper skeletons and conversion rate display.
  • frontend/src/scenes/surveys/components/StackedBar.tsx: Implements dynamic response segmentation with tooltips.
  • frontend/src/scenes/surveys/SurveyView.tsx: Integrates the new stats component.
  • frontend/src/scenes/surveys/surveyLogic.tsx: Refines user stats to avoid duplicate counts and support conversion rates.

6 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Apr 4, 2025

Size Change: +171 B (0%)

Total Size: 13.2 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 13.2 MB +171 B (0%)

compressed-size-action

Copy link
Contributor

@ioannisj ioannisj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of minor comments from me.

@marandaneto
Copy link
Member

@lucasheriques i find a bit odd the seen but no responses, does that mean the pop up is still open or what?
are there cases where the survey is shown but not dismissed/responded?

@lucasheriques
Copy link
Contributor Author

@marandaneto yes there is a significant number of impressions but no action. it means the survey was displayed (and will be displayed again if the user comes back), but no action was taken

if you check our suver here, you'll see that 26% is unanswered (maybe I chan change back to this label instead)

@marandaneto
Copy link
Member

@marandaneto yes there is a significant number of impressions but no action. it means the survey was displayed (and will be displayed again if the user comes back), but no action was taken

if you check our suver here, you'll see that 26% is unanswered (maybe I chan change back to this label instead)

Unanswered makes more sense then

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@lucasheriques lucasheriques merged commit 28243e1 into master Apr 8, 2025
110 checks passed
@lucasheriques lucasheriques deleted the feat/improvements-for-survey-stats branch April 8, 2025 18:42
hpouillot pushed a commit that referenced this pull request Apr 9, 2025
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants