Skip to content

chore: allow all surveys to be repeated #30782

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

Conversation

lucasheriques
Copy link
Contributor

@lucasheriques lucasheriques commented Apr 3, 2025

Problem

we've heard feedback of people wanting to test surveys but being hard to do, since a survey is only able to show once - except for feedback surveys.

This PR changes it allowing all surveys to have the schedule always.

needs PostHog/posthog-js#1866

Changes

I added banner for popover surveys, since there's a potential issue of a banner happening multiple times.

survey with waiting period:

CleanShot 2025-04-08 at 15 22 44@2x

survey with no waiting period and any display conditions:

CleanShot 2025-04-08 at 15 23 06@2x

survey with no display conditions at all:

CleanShot 2025-04-08 at 15 23 30@2x

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

How did you test this code?

@lucasheriques lucasheriques requested a review from a team April 3, 2025 22:48
@lucasheriques lucasheriques self-assigned this Apr 3, 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 introduces support for the "Always" schedule, enabling all surveys to be repeated, and adds a warning for potential over-display in popover surveys.

  • /frontend/src/scenes/surveys/SurveyRepeatSchedule.tsx: Added conditional rendering of a warning banner for popover surveys when "Always" is selected and updated reset logic for iteration fields.
  • /frontend/src/scenes/surveys/SurveyWidgetCustomization.tsx: Modified the checkbox toggle to set survey schedule to "Always" on selection, while resetting iteration_count and iteration_frequency_days to 0.

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

Copy link
Contributor

github-actions bot commented Apr 3, 2025

Size Change: +49 B (0%)

Total Size: 13.2 MB

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

compressed-size-action

@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 1)
  • 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

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

  • chromium: 0 added, 1 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.

@ioannisj
Copy link
Contributor

ioannisj commented Apr 4, 2025

I think we may also want to update the info tip here.

@marandaneto
Copy link
Member

@lucasheriques something to consider here is the breaking change. this might be undesired for customers with this setting

@lucasheriques
Copy link
Contributor Author

@ioannisj fort he tooltip I agree, but need to first merge the posthog-js part to know the version

@marandaneto currently the always is limited to widget surveys, so no breaking changes

@marandaneto
Copy link
Member

@ioannisj fort he tooltip I agree, but need to first merge the posthog-js part to know the version

@marandaneto currently the always is limited to widget surveys, so no breaking changes

Exactly, and after the JS SDK change will be for all surveys, which is a breaking change, it will be appearing for all surveys instead of only widget surveys which is not what people intended when enabled this feature, or did i misunderstand that?

@lucasheriques
Copy link
Contributor Author

@marandaneto yes, once/if we go forward if these JS SDK changes, this schedule will be available for all surveys.

But, right now we're still restricting it to only widget surveys on our UI, so there are no other cases of surveys with the always schedule that are not widget surveys. So the behavior will still be the same - just removing this restriction from our side.

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

@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 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 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@lucasheriques lucasheriques merged commit 643de17 into master Apr 9, 2025
109 checks passed
@lucasheriques lucasheriques deleted the chore/allow-every-survey-to-be-repeated-multiple-times branch April 9, 2025 02:14
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