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
Add query variables for easy linking #291
Add query variables for easy linking #291
Conversation
* Add user-query-params library, upgrade query-string * Create a configuration for query parameters * Update query parameters whenever calculator changes * Adjust scroll behavior to avoid changing variables
Deploy preview for microcov ready! Built with commit 9d079cd |
I don't know how to fix the remaining 3 lint issues. |
* Fix return types
Wow, thanks! I was planning to get back to lint today |
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.
I'm getting this error when I try to run your PR locally. And the netlify version isn't working either: https://deploy-preview-291--microcov.netlify.app
Can you take a look into this and let us know what you see?
Strange, I see this now too. |
By default, the query object contains undefined values. I'm not sure if this is exactly the right API, but it shoudl be working in the base case now.
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.
This is a great idea; I really like that it allows sharing and linking!
* use pickBy for filterParams * More descriptive funcion name for useQueryData, better documentation * Move useQueryParams call to Calculate
Question/idea: I wonder if it would be a better user experience to not automatically this long series of params to the URL and instead to give them a "send a link to this scenario to a friend" button that automatically copies it to the clipboard. Thoughts? |
@blanchardjeremy I had the same thought - If you wanted to install a block of share buttons it might make more sense to move this functionality there. This is slightly more aggressive from a growth perspective but it's really a cosmetic choice in the end. |
Also I'm not sure how to re-run CircleCI builds, but the lint errors seem to be unrelated to the code |
@cameronmarlow hmmm. I haven't tried to run the code yet. You've probably already done this, but did you run "yarn fix") |
I'm seeing this erroe
I'm not 100% sure what the source of that is either. Maybe delete your package log and run yarn install? |
@cameronmarlow we are hoping to get this ready to go in the next day or two for a reporter who wants to link to specific scenarios. So let me know if I can support in any way! |
@cameronmarlow I propose we merge this pull request and then start the work on migrating it to a button (or series of share buttons) next. Would you be open to heading up that effort? |
Looks good to me now. Thanks so much for this, @cameronmarlow! |
Thanks for getting this over the finish line! I'll take a pass at translating this into a button tomorrow. |
@cameronmarlow your feature made it possible for this news article to link to specific scenarios: https://www.vox.com/21504747/trump-coronavirus-superspreader Thanks! 🙌 |
Awesome! That's exactly why I got interested in it. I was trying to do the same thing myself: https://overstated.net/2020/10/02/calculating-risk-with-microcovids/ |
It's currently hard to share microcovid results for a specific set of assumptions. It would be really nice to, say, link to the assumptions for the presidential debate. This PR adds the use-query-param library and automatically updates query params based on changes to the form for easy sharing.