Add favorites feature with heart icons and IndexedDB storage to CustomCard components #64
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.
This PR implements a complete favorites system for CA Resources, allowing users to bookmark their favorite resources with persistent storage across browser sessions.
🎯 Features Added
Heart Icon Integration: Each CustomCard now displays a clickable heart icon that users can tap to add or remove items from their favorites. The heart fills with red when favorited and remains outline when not.
Persistent Storage: Favorites are stored locally using IndexedDB, ensuring they persist across page refreshes and browser sessions without requiring user accounts or external storage.
Auto-Generated IDs: Each card automatically generates a unique identifier based on its title and href, ensuring consistent identification across the application.
Visual Feedback: Clear visual indication of favorite status with smooth transitions and proper accessibility labels.
🛠️ Technical Implementation
lib/favorites.ts: New utility file containing IndexedDB operations, ID generation, and React hooks for state management🎨 Visual Result
The feature integrates seamlessly with the existing design:
⚡ Performance & Compatibility
The implementation follows the project's styling guidelines and maintains the existing component API while adding powerful new functionality for user experience enhancement.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
gvmemz92tx.ufs.shnext-server (v15.4.1)(dns block)https://api.github.com/repos/bryan308/ca-resources/commits/usr/local/bin/node /home/REDACTED/work/ca-resources/ca-resources/node_modules/next/dist/compiled/jest-worker/processChild.js(http block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.