Skip to content
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(surveys): preact surveys components #964

Merged
merged 38 commits into from
Feb 15, 2024
Merged

Conversation

liyiy
Copy link
Contributor

@liyiy liyiy commented Jan 23, 2024

Changes

Converts surveys into components

How to manually test:

  1. Follow the instructions for linking this version of posthog-js to your main posthog branch https://github.com/PostHog/posthog-js?tab=readme-ov-file#developing-together-with-another-project

  2. Test any and all flows including:

  • All survey types
  • Single and multiple choice open ended select
  • Multiple question surveys
  • Customization with colors, branding, html in description, etc.
  • Survey results look correct
  • Feedback tab and custom selector widget

Checklist

@liyiy liyiy marked this pull request as ready for review January 25, 2024 22:16
@PostHog PostHog deleted a comment from posthog-bot Jan 25, 2024
Copy link

github-actions bot commented Jan 25, 2024

Size Change: +15.9 kB (+2%)

Total Size: 860 kB

Filename Size Change
dist/array.full.js 183 kB +134 B (0%)
dist/array.js 124 kB +131 B (0%)
dist/es.js 124 kB +131 B (0%)
dist/module.js 125 kB +131 B (0%)
dist/surveys.js 64.3 kB +15.4 kB (+32%) 🚨
ℹ️ View Unchanged
Filename Size
dist/exception-autocapture.js 12 kB
dist/recorder-v2.js 105 kB
dist/recorder.js 58.6 kB
dist/surveys.esm.js 64.2 kB

compressed-size-action

@liyiy
Copy link
Contributor Author

liyiy commented Jan 30, 2024

I added a bunch of e2e tests and also manually went through the flows, but would very much appreciate a second or third look from others! 🙏

@neilkakkar
Copy link
Collaborator

Great job adding all the e2e tests! 🚀

Suggestion: Split e2e tests into a separate PR, merge it first, so we can confirm they work well with both the old and new code

Copy link
Collaborator

@benjackwhite benjackwhite left a comment

Choose a reason for hiding this comment

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

Bunch of comments, mostly about code quality rather than the functionality itself. I think its worth the extra effort to make this a little tidier now (otherwise it will likely not happen 🙈 )

src/extensions/surveys.tsx Outdated Show resolved Hide resolved
src/extensions/surveys.tsx Outdated Show resolved Hide resolved
src/extensions/surveys.tsx Outdated Show resolved Hide resolved
src/extensions/surveys.tsx Outdated Show resolved Hide resolved
src/extensions/surveys.tsx Outdated Show resolved Hide resolved
src/extensions/surveys.tsx Outdated Show resolved Hide resolved
src/extensions/surveys.tsx Outdated Show resolved Hide resolved
src/extensions/surveys.tsx Outdated Show resolved Hide resolved
src/extensions/surveys.tsx Outdated Show resolved Hide resolved
src/extensions/surveys.tsx Outdated Show resolved Hide resolved
@liyiy
Copy link
Contributor Author

liyiy commented Feb 5, 2024

Thanks @benjackwhite for the thorough review. I've either added in the fixes or left the less urgent ones as TODOs. Let me know if I've missed anything !

@benjackwhite benjackwhite self-requested a review February 6, 2024 16:41
benjackwhite and others added 4 commits February 8, 2024 14:36
* Refactor

* Fix

* fix?

* fix?

* option 2

* refactor and fixes

---------

Co-authored-by: Neil Kakkar <[email protected]>
Co-authored-by: Li Yi <[email protected]>
Copy link
Collaborator

@benjackwhite benjackwhite left a comment

Choose a reason for hiding this comment

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

This is much nicer! Easy to review, easy to see how one would make changes later. This was definitely worth the extra investment from my perspective.

Haven't tested the functionality itself - I would watch this like a hawk after it gets merged and ensure that there are no surprises...

@liyiy liyiy added bump major Bump major version when this PR gets merged bump minor Bump minor version when this PR gets merged and removed bump major Bump major version when this PR gets merged labels Feb 12, 2024
@liyiy liyiy closed this Feb 12, 2024
@liyiy liyiy reopened this Feb 12, 2024
Copy link
Collaborator

@neilkakkar neilkakkar left a comment

Choose a reason for hiding this comment

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

🚀

* Refactor

* Fix

* fix?

* fix?

* option 2

* refactor and fixes

* wip

* only export preview render

* read only mode for preview

* fix import

* add question index preview state

* refactor auto text color

* remove right css for preview

* border radius fix

* remove comments

* move render into loader-surveys

* add test and undo optional param

* type fixes

---------

Co-authored-by: Ben White <[email protected]>
Co-authored-by: Neil Kakkar <[email protected]>
@liyiy liyiy merged commit d47bbc9 into main Feb 15, 2024
13 checks passed
@liyiy liyiy deleted the preact-surveys-components branch February 15, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor Bump minor version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants