Experiment: Preserve customer support form info between refreshes - #3363
Open
lvachon1 wants to merge 4 commits into
Open
Experiment: Preserve customer support form info between refreshes#3363lvachon1 wants to merge 4 commits into
lvachon1 wants to merge 4 commits into
Conversation
…eloads. This is a bandaid until we can properly fix this page.
… modify the form get a chance to fire when loading from localStorage
joshlarson
requested changes
Jul 28, 2026
joshlarson
left a comment
Contributor
There was a problem hiding this comment.
This is a great change! I left a few comments/suggestions. The one thing that's holding me back from approving is the invalid-JSON thing... I know it's unlikely, but rule 1 about getting data from users is to assume that it's probably invalid or wrong in some way 😅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Asana Ticket: 🙋 Investigate customer support form reloading issues
Implementation
As part of the above investigation I have written a stop-gap/band-aid fix that will make the experience less frustrating for users that experience page refreshes.
This JS code saves the state of the form in localStorage when any field is changed. If the page is refreshed/loaded and the cached form data is <24h old, it will fill out the form and put the user back where they were.
Unfortunately it is not allowed to set file inputs from JS, the user will have to manually re-select them.
The Captcha will/should not be affected either. Those clicks actually expire after a few minutes.
Screenshots
Screen.Recording.2026-07-27.at.11.47.27.AM.mov
How to test
http://localhost:4001/customer-support
Play with the form, put it into various states, refresh and see if it behaves as expected. Drop-downs, text fields, hidden/shown sections and checkboxes should all resume their previous state upon refresh. If a user is typing when the form crashes/refreshes they should lose at most 1 character.
Moving Forward
It appears that our DotcomWeb controllers import Phoenix.LiveView and that establishes a websocket connection and hearbeats. However, on this page at least, no other data is being sent that way. I think we should see if we can remove that requirement and see if the lack of a websocket connection will help.