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

✅[outreachy] Registry : Add to favorites #5447 #5451

Closed
wants to merge 9 commits into from

Conversation

mailsg
Copy link

@mailsg mailsg commented Oct 21, 2024

Fixes

Description

  • This PR introduces a "Add to Favorites" feature, allowing users to quickly mark registry entries as favorites. Favorites are stored locally in local storage, ensuring persistence across sessions.
    • Implemented a button for adding/removing items from favorites.
    • Favorites are stored in local storage for better user experience.
    • Integrated the functionality using a favorite-btn that updates dynamically.

Technical details

  • Partial for JavaScript: Moved JavaScript functionality to a separate js/addToFavorites.js file, loaded via a partial in the layout for better maintainability and performance.

  • Local Storage Logic: The local storage checks if an item is already marked as a favorite, and updates the button's appearance accordingly. This avoids the need for server-side calls, keeping it fast and client-side focused.

Screenshots

SS1

SS2

SS3

Copy link

linux-foundation-easycla bot commented Oct 21, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@mailsg mailsg changed the title Registry : Add to favorites #5447 [WIP] Registry : Add to favorites #5447 Oct 21, 2024
@mailsg mailsg marked this pull request as ready for review October 21, 2024 18:51
@mailsg mailsg requested a review from a team as a code owner October 21, 2024 18:51
@mailsg mailsg changed the title [WIP] Registry : Add to favorites #5447 Registry : Add to favorites #5447 Oct 21, 2024
@svrnm
Copy link
Member

svrnm commented Oct 22, 2024

@mailsg: I see that I can add favorites, have you planned any way that I can use the favorites, e.g. only see the favorites or any other way?

@mailsg, I don't have a registration from you as a contributor in the outreachy platform. Since I have closed the project, I will close your isse and PR. Thank you for participating in outreachy!

@svrnm svrnm added the outreachy Issues for Outreachy Participants label Oct 22, 2024
@svrnm svrnm changed the title Registry : Add to favorites #5447 [outreachy] Registry : Add to favorites #5447 Oct 22, 2024
@svrnm svrnm closed this Oct 22, 2024
@svrnm svrnm reopened this Oct 22, 2024
@svrnm
Copy link
Member

svrnm commented Oct 22, 2024

@mailsg please make sure that you register with the outreachy platform after that I will provide a review

@svrnm
Copy link
Member

svrnm commented Oct 23, 2024

thanks for registering your contributions in the outreachy platform. Following up with my previous feedback:

I see that I can add favorites, have you planned any way that I can use the favorites, e.g. only see the favorites or any other way?

@mailsg
Copy link
Author

mailsg commented Oct 23, 2024

thanks for registering your contributions in the outreachy platform. Following up with my previous feedback:

I see that I can add favorites, have you planned any way that I can use the favorites, e.g. only see the favorites or any other way?

Hi @svrnm,

In addition to providing users with the ability to add and remove items from their favorites, there are several practical ways to make this feature more useful. These can be the planned usage of the Add to Favorites feature :

  1. Dedicated "Favorites" Page

    • Users will be able to view all of their favorite marked items in one place by navigating to a dedicated "Favorites" page. This page will aggregate all marked items for easy access.
    • This allows users to quickly locate their preferred resources without having to search through the entire registry each time.
  2. Filter by Favorites

    • An additional filter could be added to the registry that allows users to view only their favorite marked items while browsing the main catalog. This would integrate the favorites functionality directly into the registry interface, making it more user-friendly and efficient for users looking to engage with their curated resources.
  3. Persistence Across Sessions

    • Since the favorites are stored in local storage or session cookies, users can access their list of favorites even after logging out or closing the browser. This ensures that the favorites list persists across sessions, improving the user experience by providing continuity.
  4. Improved Personalization

    • With a user's favorites data available, the site could later introduce personalized content suggestions based on their favorites, such as related tools, newly added components, or relevant updates. This could lead to better user satisfaction and engagement without requiring significant changes to the initial feature implementation.
  5. Future Expansions

    • In the future, favorites could serve as the foundation for more advanced features, such as exporting favorite lists, sharing with others, or receiving notifications when an item in their favorites is updated. These expansions would make the feature even more valuable to users while aligning with the overall goal of improving user experience.

To conclude, the Add to Favorites feature is designed to make the registry more user-friendly and personalized. By giving users a dedicated page for their favorites, a filter to view only their selected items, and ensuring everything is saved across sessions, we are making it easier for users to engage with the platform in a way that works for them. This will not only make the registry more useful on a day-to-day basis, but it also sets the stage for future improvements like personalized recommendations or sharing favorites with others. Overall, I think this can be a step towards making the site more interactive and valuable for the community.

Thanks.

@svrnm
Copy link
Member

svrnm commented Oct 23, 2024

Please implement "Filter by Favorites". Thanks.

@mailsg
Copy link
Author

mailsg commented Oct 23, 2024

Please implement "Filter by Favorites". Thanks.

Description

  • The JavaScript functionality enhances user interaction with the registry by allowing users to filter their view to display only their favorite entries. This feature simplifies navigation by letting users focus on items they are most interested in.

Technical details

  • The implementation consists of event listeners that manage user interactions with the Show Favorites button. When a user selects to view only their favorites, the system checks against local storage to display the appropriate items and toggling Show Favorites to Show All.
  • When the user selects Show All, they can view all the registry items.

SS-1

SS-2

Thanks.

Copy link
Member

@svrnm svrnm left a comment

Choose a reason for hiding this comment

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

overall lgtm, a few comments

.htmltest.yml Outdated
Comment on lines 11 to 15
- ^blog/(\d+/)?page/\d+
# TODO drop next line after https://github.com/open-telemetry/opentelemetry.io/issues/5423 is fixed for ja pages:
- ^ja/docs/concepts/instrumentation/libraries/
# TODO drop next line after https://github.com/open-telemetry/opentelemetry.io/issues/5423 is fixed for pt pages:
- ^pt/docs/concepts/instrumentation/libraries/
- ^blog/(\d+/)?page/\d+
Copy link
Member

Choose a reason for hiding this comment

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

please revert this change

} else {
favorites.push(registryId);
localStorage.setItem('favorites', JSON.stringify(favorites));
button.innerHTML = '<i class="fa-solid fa-star"></i>';
Copy link
Member

Choose a reason for hiding this comment

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

Remove from favorites to make it clear that it is a favorite and can be removed by clicking on the star once again

@mailsg
Copy link
Author

mailsg commented Oct 24, 2024

overall lgtm, a few comments

Hi @svrnm,

I have made the suggested changes.

SS-1

Thanks.

@mailsg mailsg requested a review from svrnm October 24, 2024 10:31
@svrnm svrnm changed the title [outreachy] Registry : Add to favorites #5447 ✅[outreachy] Registry : Add to favorites #5447 Oct 24, 2024
@svrnm
Copy link
Member

svrnm commented Oct 24, 2024

I consider this as done! After the outreachy application phase we will take another look and see if we can merge this PR. Thank you!

@svrnm
Copy link
Member

svrnm commented Dec 11, 2024

I will close this for now, since I raised a follow up discussion here: #5759

if you are interested in continuing contributing, please take a look! If we agree to build this, you can give it a try!

Thanks

@svrnm svrnm closed this Dec 11, 2024
@svrnm svrnm added registry and removed outreachy Issues for Outreachy Participants labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[outreachy] Registry: Add to favorites
2 participants