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

Improve feedback when saving locations, add toast notifications #992

Merged
merged 17 commits into from
Sep 21, 2023

Conversation

binh-dam-ibigroup
Copy link
Collaborator

@binh-dam-ibigroup binh-dam-ibigroup commented Sep 7, 2023

Description

This PR improves the user feedback from setting the home or work locations, from the map and the places editor, notably with toast notifications or alerting logged out users they need to log in. Some other confirmation alert messages are also converted into toast notifications.

Under the hood, the added react-hot-toast package improves the "politeness" of the confirmation messages shown.

PR Checklist

  • Does the code follow accessibility standards (WCAG 2.1 AA Compliant)?
  • Are all languages supported (Internationalization/Localization)?
  • Are appropriate Typescript types implemented?

@binh-dam-ibigroup binh-dam-ibigroup changed the title Add toast notifications Improve feedback when saving locations, add toast notifications Sep 7, 2023
@binh-dam-ibigroup binh-dam-ibigroup marked this pull request as ready for review September 11, 2023 14:02
Copy link
Contributor

@amy-corson-ibigroup amy-corson-ibigroup left a comment

Choose a reason for hiding this comment

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

Looks good! Tested on mobile and AT.

It would be great to move all window.alerts over to Toast, as this does make the user alerts a little inconsistent, but I think this is a great place to start!!

@@ -138,7 +139,7 @@ export function convertToLegacyLocation(place) {
lon,
// HACK: If a place name and address are provided, put the address in parentheses
// to mimic the existing LocationField behavior for "work" and "home".
// TODO: use addInParentheses from location-field (requires passing an intl contexty).
// TODO: use addInParentheses from location-field (requires passing an intl context).
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Member

@AdrianaCeric AdrianaCeric left a comment

Choose a reason for hiding this comment

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

I think Toast is a cool package, good work! Just one comment

i18n/en-US.yml Outdated
@@ -52,6 +52,8 @@ actions:
emailVerificationResent: The email verification message has been resent.
genericError: "An error was encountered: {err}"
itineraryExistenceCheckFailed: Error checking whether your selected trip is possible.
mustBeLoggedInToSavePlace: Please log in to save locations.
placeRemembered: "Your {placeType} has been set to: {address}."
Copy link
Member

Choose a reason for hiding this comment

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

placeType is either "custom" or "dining" which results in the alert becoming either:

  • "Your custom has been set to: Sesame Street."
  • "Your dining has been set to: Sesame Street."

Adding something like "place type" would help make this alert more clear

Suggested change
placeRemembered: "Your {placeType} has been set to: {address}."
placeRemembered: "Your {placeType} place type has been set to: {address}."

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point! I changed the confirmation popup in e1c6453 so it shows the correct place name, and did away with showing the address as there can be other settings for places later.

@binh-dam-ibigroup binh-dam-ibigroup removed their assignment Sep 21, 2023
Copy link
Member

@AdrianaCeric AdrianaCeric left a comment

Choose a reason for hiding this comment

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

Looks good with the change!

@binh-dam-ibigroup binh-dam-ibigroup merged commit 6772fa9 into dev Sep 21, 2023
6 checks passed
@binh-dam-ibigroup binh-dam-ibigroup deleted the add-toast-notifications branch September 21, 2023 21:29
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.

3 participants