Open mathalav55 opened 5 days ago
The changes in this pull request enhance the drag-and-drop functionality across several components related to favorites management. Key modifications include the introduction of a new handleReorder
method for reordering favorites, updates to existing methods for moving favorites between folders, and improvements to the drag preview logic. The Props
types in various components have been updated to accommodate these new functionalities, ensuring a more intuitive user experience when managing favorite items.
File Path | Change Summary |
---|---|
web/core/components/workspace/sidebar/favorites/favorite-folder.tsx |
- Added imports for drag-and-drop functionality. - Updated Props type to include handleReorder method.- Renamed handleOnDrop to handleMoveToFolder and modified its implementation.- Enhanced drag preview generation logic. - Updated useEffect to link to new drag-and-drop logic.- Modified child favorites mapping using orderBy . |
web/core/components/workspace/sidebar/favorites/favorite-items/root.tsx |
- Added imports for drag-and-drop utilities. - Updated Props type to include handleReorder method.- Modified drag operation data structure in useEffect .- Updated onDrop handler to manage item reordering.- Enhanced drag preview generation logic. |
web/core/components/workspace/sidebar/favorites/favorites-menu.tsx |
- Introduced handleReorder method utilizing reOrderFavorite from the useFavorite hook.- Passed handleReorder prop to FavoriteFolder and FavoriteRoot components.- Updated destructured return from useFavorite to include reOrderFavorite . |
web/core/store/favorite.store.ts |
- Renamed moveFavorite to moveFavoriteToFolder and moveFavoriteFolder to reOrderFavorite in IFavoriteStore interface.- Updated constructor and method logic in FavoriteStore class to reflect these changes. |
web/core/components/workspace/sidebar/favorites/favorites.helpers.ts |
- Added new type TargetData for drag-and-drop context.- Updated getDestinationStateSequence function for reordering logic.- Introduced getInstructionFromPayload and getCanDrop functions for improved drop validation. |
web/core/components/workspace/sidebar/projects-list-item.tsx |
- Adjusted Disclosure component's ref to enhance drag-and-drop functionality.- Updated onDrop event handler for correct parameter invocation.- Refined DropIndicator visibility logic. |
FavoriteFolder
component are related to the enhancements in the FavoriteRoot
component, both focusing on improving drag-and-drop functionality and reordering logic for favorites.SidebarFavoritesMenu
component's updates to include the handleReorder
method align with the changes in the FavoriteFolder
component, which also involves reordering favorites.FavoriteFolder
component to handle folder-specific logic during drag-and-drop operations are directly related to the enhancements made in the FavoriteRoot
component.FavoriteFolder
component to manage favorite folders and the introduction of new props are relevant to the updates in the FavoriteItem
component, which also deals with favorite management.FavoriteFolder
component to improve the handling of favorites are relevant to the updates in the FavoriteItem
component, which also focuses on managing favorite items.SidebarFavoritesMenu
and useFavoriteItemDetails
hook to handle favorite entity data are related to the changes in the FavoriteFolder
component, which also addresses similar data handling issues.FavoriteItemTitle
component to streamline props and logic are relevant to the changes in the FavoriteRoot
component, which also focuses on managing favorite items effectively.🌟enhancement
, 🛠️refactor
🐇 In the land of favorites, we hop and play,
With drag-and-drop magic, we brighten the day.
Reorder with ease, let the items align,
A seamless experience, oh how divine!
So grab your favorites, let’s dance and cheer,
For improvements are here, let’s spread the good cheer! 🎉
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary:
Added functionality to re-order entities under Favorites section. Project highlight fix. Only highlighting the last project dropped.
Reference:
[WEB-2774]
Summary by CodeRabbit
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Refactor