Skip to content

feat(ui): add Favorites (❤️) for languages with localStorage + “View Favorites” filter#381

Open
syedk03 wants to merge 1 commit intodiwas7777:mainfrom
syedk03:feat/favorites-ui
Open

feat(ui): add Favorites (❤️) for languages with localStorage + “View Favorites” filter#381
syedk03 wants to merge 1 commit intodiwas7777:mainfrom
syedk03:feat/favorites-ui

Conversation

@syedk03
Copy link

@syedk03 syedk03 commented Dec 11, 2025

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.

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.

Add “Favorite” Option for Each Language and a “View Favorites” Button

1 participant