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

Add Ski Area favorite functionality backed by local storage #150

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

maxmchu
Copy link

@maxmchu maxmchu commented Jan 24, 2025

Product changes

  • This PR adds the ability to add favorite Ski Areas to OpenSkiMap. Favorites are stored locally in the browser.
  • Favorites are displayed in the Sidebar below the Privacy / Cookie Policy links, and ordered in reverse chronological order of when they were added.
    Screenshot 2025-01-23 at 11 19 19 PM
  • Favorites can be added by tapping on the Heart icon in the bottom right corner of the Info Card.
    Screenshot 2025-01-23 at 11 32 58 PM
  • Tapping on a Favorite Ski Area in the sidebar will pan the map to that Ski Area and open the Info Card.
    Screenshot 2025-01-23 at 11 19 26 PM
  • Favorites can be removed by tapping on the Heart icon on the associated info card.

Video demo

compress.mov

In this video, we do the following:

  • Start with a fresh map with no favorites added.
  • We add some favorite ski resorts
  • We tap on the favorites and pan around the map
  • We refresh the page, showing that the favorites persist
  • We remove a favorite and verify it no longer shows in the sidebar

Technical details

  • Add a FeatureFavoriteService managing local storage of Favorite Features -- this service is capable of handling favoriting Runs + Lifts, but I personally find that Ski Areas is probably the most helpful.
  • Local storage stores a Map of IDs to metadata objects that store the ID, the feature type, and when the favorite was added. The feature information is fetched when opening the Sidebar.
  • Add a FeatureFavorites component that is embedded into the Sidebar component to render ListItems/Buttons
  • Add a FeatureFavoriteControl component that is embedded into the SkiAreaInfo component in the bottom-right corner by adding it as an Action

@maxmchu maxmchu marked this pull request as ready for review January 24, 2025 04:37
@maxmchu
Copy link
Author

maxmchu commented Jan 24, 2025

Added a commit to add tooltip explanation messages:

Screenshot 2025-01-24 at 9 17 20 AM
Screenshot 2025-01-24 at 9 17 34 AM

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.

1 participant