feat(ui): add Favorites (❤️) for languages with localStorage + “View Favorites” filter#381
Open
syedk03 wants to merge 1 commit intodiwas7777:mainfrom
Open
feat(ui): add Favorites (❤️) for languages with localStorage + “View Favorites” filter#381syedk03 wants to merge 1 commit intodiwas7777:mainfrom
syedk03 wants to merge 1 commit intodiwas7777:mainfrom
Conversation
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.
Summary
Adds a Favorites flow to the Languages grid:
Heart (❤️) button on each language card to toggle favorite
“View Favorites” button near the “Programming Languages” header
Persisted via localStorage so favorites survive refresh
Accessible: keyboard toggle (Enter/Space), aria-pressed, focus outline
How it works
On page load, favorites are read from localStorage (codeshub:favorites).
Each card has a heart button that toggles the language’s favorite state and updates storage.
The “View Favorites” button filters the grid to only favorite languages (toggle on/off).
If localStorage is unavailable, the feature still works for the session (no crash).
Manual Testing
Click ❤️ on 2+ languages → icon fills and stays filled after reload.
Click View Favorites → grid shows only those; click again to see all.
Keyboard: Tab to the heart, press Space/Enter to toggle; aria-pressed flips true/false.
DevTools → Application → Local Storage → confirm codeshub:favorites JSON array.
Issue
Closes #379.