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

feature/auto close survey #310

Merged
merged 18 commits into from
May 29, 2023
Merged

feature/auto close survey #310

merged 18 commits into from
May 29, 2023

Conversation

moritzrengert
Copy link
Contributor

@moritzrengert moritzrengert commented May 26, 2023

What does this PR do?

Adds the option to set an autoClose delay in seconds, that closes the in-product survey if it is not hovered or clicked within the specified time. Also prepared the logic to include in the survey preview.

image

image

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change adds a new database migration
  • This change requires a documentation update

How should this be tested?

  • Check if it isnt closing if autoClose is off
  • Check if it is closing after x seconds for a few times
  • Check if it isnt closing if the survey is hovered within the time

Checklist

  • I have read the contributing guide
  • I have performed a self-review of my own code and corrected any misspellings
  • I have added comments to my code, particularly in hard-to-understand bits
  • I ran pnpm build and pnpm lint and checked for build and linting errors
  • My contribution does not cause any warnings
  • I have removed all console.logs
  • I have merged the latest changes from main onto my branch with git pull origin main
  • My contribution causes changes to the Formbricks Docs

@vercel
Copy link

vercel bot commented May 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
formbricks-cloud ❌ Failed (Inspect) May 29, 2023 10:46am
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
formbricks-com ⬜️ Ignored (Inspect) May 29, 2023 10:46am
formbricks-legacy ⬜️ Ignored (Inspect) May 29, 2023 10:46am

Copy link
Member

@mattinannt mattinannt left a comment

Choose a reason for hiding this comment

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

@moritzrengert thanks for the feature and for providing detailed screenshots 😊🙏 I have a few suggestions and bugs I would like you to solve first before we can merge:

  • When auto-close is activated we need to display some kind of indicator to the user that the modal is closing automatically. My first idea was a reverse progress bar on top (in brand color) that starts full, gets smaller and ends empty when the number of seconds to auto-close elapsed.
Screenshot 2023-05-26 at 15 22 26
  • I have a problem with auto-close when the survey is triggered by a button click: Create a survey that is triggered on an event that is send on button click, go to the app and click the button, the modal opens and auto-closes correctly. but when I press again the widget closes after a very short (random) time and I don't see the closing animation and it just disappears.

  • When edit the auto-close time, click into the input field, delete the current value (6) and then write another value (e.g. 2), I always get a 0 in front. I would like to have it without the 0:

Screenshot 2023-05-26 at 15 30 45
  • Please also fix the merge conflicts that just come up 😊

@moritzrengert
Copy link
Contributor Author

Fixed the mentioned bugs and added the countdown progress bar. 🙂

image

@moritzrengert
Copy link
Contributor Author

Please check the countdown behaviour in the SurveyPreview, as I was not sure about the expected result @mattinannt.
Currently it runs once on load and also when the autoClose value is modified but has no effect once it's finished. I thought it would make the effect more clear to the user.

Copy link
Member

@mattinannt mattinannt left a comment

Choose a reason for hiding this comment

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

@moritzrengert thanks a lot for the changes 🤗 Works great and I am going to merge it now 😊
Only the stop-motion progressbar doesn't really feel nice, but I will let Johannes check if he can fix that with a smoother CSS animation.

@mattinannt mattinannt deleted the feature/auto-close-survey branch May 29, 2023 10:48
waseemrabani pushed a commit to LuminosoInsight/formbricks that referenced this pull request Feb 2, 2024
* add option to aut-close a in-app survey

---------

Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants