favrotie secrets#25
Closed
ogardoni wants to merge 1 commit into
Closed
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Database Changes
Added an isFavorite boolean field to the Secret model in the Prisma schema
Created and ran migrations to update the database structure
Type Updates
Updated the SecretWithDecryptedData and related types to include the isFavorite property
Ensured consistent typing across the application
Backend Logic
Modified _secretActions.ts to include:
A toggleFavorite function to toggle the favorite status of a secret
Updated getAllSecretsWithVaults to accept a filter parameter for favorites
Refactored getFavoriteSecrets to use the new filter logic
Client-Side Logic
Created a proper TypeScript React component file favorites-client.tsx that includes:
A useFavorites hook for managing favorite-related state and actions
A FavoriteButton component for toggling favorite status
A FavoritesEmptyState component for displaying when no favorites exist
A FavoritesQuickAccess component that shows a card with the top 5 favorites
UI Components
Enhanced secrets-list.tsx with:
A star icon button to toggle favorite status in secret cards
A dropdown menu option to toggle favorites
A FavoriteSecretsList component that displays only favorite secrets
Added query keys for favorites to manage cache invalidation
Updated sidebar-vault-list.tsx to include a "Favorite Secrets" navigation button
Created a dedicated page at page.tsx to display favorite secrets
Fixed TypeScript Errors
Renamed the file from .ts to .tsx to support JSX syntax
Added proper React imports
Fixed export and import issues
The feature now allows users to:
Mark any secret as a favorite with a single click
View all their favorite secrets in a dedicated "Favorites" section
Access their most important secrets quickly from any page
Toggle the favorite status from multiple locations in the UI
All changes were made with TypeScript type safety in mind, an