-
Notifications
You must be signed in to change notification settings - Fork 8
Add favorites functionality #74
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a favorites functionality that lets users mark feed items as favorites, persist them in IndexedDB, and manage them via UI components and data export/import features.
- Added migration and updates to IndexedDB functions for a new Favorites table.
- Created favorites service functions and a custom hook (useFavorites) for managing favorites state and actions.
- Updated UI components (FeedItem, FavoritesList, ExportImportForm, etc.) and pages to integrate the favorites feature.
Reviewed Changes
Copilot reviewed 20 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| services/migrations/V2_add_favorites.ts | Created a migration to add the favorites table in IndexedDB. |
| services/indexeddbCRUD.ts | Updated table creation functions to work with the new TableSchema interface. |
| services/favoritesService.ts | Added functions for getting, adding, and removing favorites using IndexedDB. |
| services/exportService.ts | Modified the export/import functions to include favorites data along with feeds. |
| pages/index.tsx | Integrated a tabbed view to support both feeds and favorites, including routing updates. |
| models/index.ts, models/TransferFeed.ts, | Updated models to include the Favorite model and adjust transfer data structure. |
| models/Favorite.ts | New Favorite model definition. |
| hooks/useFavorites.ts & hooks/index.ts | Introduced a custom hook to manage the favorite state and handle favorite actions. |
| components/* | Added/updated multiple components (FeedItem, FavoritesList, ExportImportForm, etc.) to enable favorites UI. |
Files not reviewed (3)
- components/FavoritesList/FavoritesList.module.css: Language not supported
- components/FeedItem/FeedItem.module.css: Language not supported
- package.json: Language not supported
|
I have migrated the project to |
05ca847 to
0b3b6ca
Compare
|
I know it's not a good practice, but I had to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a favorites functionality to the feed system by implementing a dedicated favorites model, services, and UI components. Key changes include:
- Adding a Favorite model and updating data transfer structures to include favorites.
- Implementing a useFavorites hook and integrating favorite toggling into FeedItem, VisitedItemsList, and NewItemsList components.
- Updating export/import functionality and workflows to support the new favorites data.
Reviewed Changes
Copilot reviewed 27 out of 31 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| models/index.ts | Exports the new Favorite model. |
| models/TransferFeed.ts | Adds favorites to the transfer data interface. |
| models/Favorite.ts | Introduces the Favorite model with necessary properties. |
| hooks/useFavorites.ts | Implements a hook to manage favorites state and toggling. |
| components/VisitedItemsList/VisitedItemsList.tsx | Integrates the useFavorites hook into visited items display. |
| components/NewItemsList/NewItemsList.tsx | Integrates the useFavorites hook into new items display. |
| components/FeedItem/FeedItem.tsx | Displays favorite button with toggling functionality. |
| components/FavoritesList/FavoritesList.tsx | Provides a UI component for viewing and managing favorites. |
| components/ExportImportForm/ExportImportForm.tsx | Updates export/import functions to handle favorites data. |
| .github/workflows/* | Updates to workflow versions and Node.js version adjustments. |
Files not reviewed (4)
- .oxlintrc.json: Language not supported
- components/FavoritesList/FavoritesList.module.css: Language not supported
- components/FeedItem/FeedItem.module.css: Language not supported
- package.json: Language not supported
Comments suppressed due to low confidence (2)
models/Favorite.ts:4
- [nitpick] The Favorite interface extends RSSParser.Item which may already include a 'link' property. Consider unifying the identifier field (either use 'url' consistently or rely on 'link') to avoid potential confusion.
url: string;
components/FavoritesList/FavoritesList.tsx:41
- [nitpick] The component uses 'favorite.url' for the key while removal functions refer to 'favorite.link'. Consider using a consistent identifier property for favorites across the codebase.
<li key={favorite.url} className={Styles.item}>
Who says "that |
strdr4605
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now let's fix commits in this PR
This is the git state on my local machine (fetched from this PR)

We don't need these commits, are they are already on cofeed-19:master. In my case, origin/master, in your case upstream/master` (probably)
You should run git rebase --interactive upstream/master (assuming upstream is cofeed-19)
When the git interactive menu opens, remove any redundant commits
and close the menu :wq.
Probably you will have to fix this conflict
Then run yarn, git add -A, git rebase --continue.
And finally git push --force. If you have issues or questions, let me know.
- updated database version to 2 and added FavoriteTable schema - introduced FavoritesList component - added functionality to add, fetch and check favorites - refactored components to integrate favorites feature - updated main page to include a tab for favorites and feeds
0b3b6ca to
3275cbb
Compare
Got it, thank you sm 😅 Was scared i messed something up, I'm not experienced with |
* feat: implement add to favorites functionality - updated database version to 2 and added FavoriteTable schema - introduced FavoritesList component - added functionality to add, fetch and check favorites - refactored components to integrate favorites feature - updated main page to include a tab for favorites and feeds * feat: add remove favorite functionality * refactor: create and integrate useFavorites hook * feat: update export/import to handle favorites * refactor: update TableSchema type and rename SiteFeed table * style: update remove button in FavoritesList * fix: update Favorite model source feed url * refactor: update favorites handling in components and useFavorites hook * refactor: remove unused feed prop from FeedItem 4be4567
|
Thanks for contribution😊 @all-contributors please add @danielavornic for code |
|
I've put up a pull request to add @danielavornic! 🎉 |

related to #73
This PR implements a favorites system that allows users to favorite/unfavorite feed links links.
Features
Implementation
Favoritemodel andfavoritesServiceuseFavoriteshookFeedItemcomponent to support favoritingScreenshots
Feeds view
For non-favorite links, the unfilled star appears on hover.
Favorites view
I hope it's ok that I show only the "X" button for unfavorite here and not the stars, given that all the links here would have a star on the left. Let me know if a consistent view for link items would be preferable, and also whether a confirmation dialog for favorite removal is too inconvenient.