feat: add project favorites with star icon and sort-to-top#147
Open
R-Hart80 wants to merge 2 commits intoCatholicOS:devfrom
Open
feat: add project favorites with star icon and sort-to-top#147R-Hart80 wants to merge 2 commits intoCatholicOS:devfrom
R-Hart80 wants to merge 2 commits intoCatholicOS:devfrom
Conversation
- Project interface: add is_favorited?: boolean field
- projectApi: add favorite() and unfavorite() methods calling
POST/DELETE /api/v1/projects/{id}/favorite
- ProjectCard: star button visible to authenticated users only;
optimistic toggle with rollback on error; accessible with
aria-label and aria-pressed attributes
- HomePage: track favorited IDs in local state, sort favorited
projects to the top within any active filter/tab;
pass accessToken and onFavoriteChange to ProjectCard
Closes CatholicOS#78
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…overrides Map Previously favoritedIds was a Set initialized once from the first page load, causing newly paginated or refetched projects to miss their is_favorited values from the server. Replace it with a favoriteOverrides Map that only stores changes made this session. The sort and display logic merges server data (source of truth) with the override map, so all pages stay correct. On API error, the rollback now calls onFavoriteChange back to the previous value, keeping the override map as the single state location. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
59 tasks
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
Projectinterface: addsis_favorited?: booleanfieldprojectApi: addsfavorite()andunfavorite()callingPOST/DELETE /api/v1/projects/{id}/favoriteProjectCard: star button shown only to authenticated users; clicking toggles the favorite state with optimistic UI (immediate visual feedback, rollback on API error); fully accessible witharia-labelandaria-pressedHomePage: tracks favorited IDs in local state and sorts favorited projects to the top within any active filter tab, maintaining existing creation-date order within each groupBehavior
Test plan
is_favorited)Closes #78
🤖 Generated with Claude Code