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

Use Svelte snapshots for Contact page & improvements #141

Merged
merged 7 commits into from
Oct 15, 2023

Conversation

WarningImHack3r
Copy link
Member

This PR slightly improves the UX on the Contact page, here's how:

Svelte snapshots

The page now uses the really simple Snapshot API in order to save the form's content whenever the user leaves the page after having filled the form. This way, if they mistakenly leave the page but come back to it right after, the form is still filled with their info.

Warning

This saving occurs when the user comes back to the contact page by using the Previous arrow of their browser, not when navigating to the contact page normally!

Other improvements

Use the load function instead of a hardcoded object

The contact info of Reuben is now loaded from the page's +page.ts instead of simply being an object lying in +page.svelte. This is mainly for aesthetic purposes as this info will likely never change, but it also allows for decluttering the <script> tag, which is always a good thing in my opinion.

Improve mail-sending workflow

A few tweaks have been made to the mail-sending workflow when submitting the form:

  • Give a more meaningful name to the parameter (nodeform)
  • Fix the error message not being logged into the console when the request fails
  • Fix the Send button not resetting to its default state after an error occurred

The changes have been separated by-commit for easier review

@WarningImHack3r
Copy link
Member Author

WarningImHack3r commented Oct 10, 2023

This PR contains changes that will be noticeable to the user (snapshot, send button reset fix & error logging), so let's bump the version!

This is as simple as changing it in package.json, and #138 will do the work for us!

It obviously means we have to merge #138 before merging this one!

Copy link
Contributor

@MinixBF MinixBF left a comment

Choose a reason for hiding this comment

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

Well i'm impressived, it's really eazy to implement and used

@WarningImHack3r
Copy link
Member Author

This PR contains changes that will be noticeable to the user (snapshot, send button reset fix & error logging), so let's bump the version! [...] It obviously means we have to merge #138 before merging this one!

Let's wait for all my other open PRs to be merged before, not only #147, so that everything is included in the changelog!

@WarningImHack3r WarningImHack3r merged commit bf203a8 into main Oct 15, 2023
@WarningImHack3r WarningImHack3r deleted the contact-snapshot branch October 15, 2023 17:22
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