-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fixed dragging with empty orphan favorites #9205
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.
PR Summary
This PR improves drag-and-drop functionality for favorites by implementing dynamic container sizing and removing fixed margins that were causing positioning issues.
- Removed hardcoded 15px margin in
/packages/twenty-front/src/modules/favorites/components/CurrentWorkspaceMemberFavorites.tsx
that was causing drop area overlap - Added dynamic height (24px/1px) for empty orphan favorites container in
/packages/twenty-front/src/modules/favorites/components/CurrentWorkspaceMemberOrphanFavorites.tsx
to create proper droppable zones - Replaced theme-based spacing with state-based container sizing for better drag-and-drop accuracy
2 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
// TODO: (Drag Drop Bug) Adding bottom margin to ensure drag-to-last-position works. Need to find better solution that doesn't affect spacing. | ||
// Issue: Without margin, dragging to last position triggers next folder drop area |
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.
style: The TODO comment is now outdated since the margin-based workaround has been removed. Either update or remove this comment to reflect the new solution.
@@ -67,7 +66,7 @@ export const CurrentWorkspaceMemberOrphanFavorites = () => { | |||
/> | |||
)) | |||
) : ( | |||
<StyledEmptyContainer /> | |||
<StyledEmptyContainer style={{ height: isDragging ? '24px' : '1px' }} /> |
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.
style: Consider using theme.spacing(3) instead of hardcoded '24px' to maintain consistency with the design system
@@ -67,7 +66,7 @@ export const CurrentWorkspaceMemberOrphanFavorites = () => { | |||
/> | |||
)) | |||
) : ( | |||
<StyledEmptyContainer /> | |||
<StyledEmptyContainer style={{ height: isDragging ? '24px' : '1px' }} /> |
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.
style: 1px height might cause layout shift when transitioning to drag state - consider using 0 instead
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.
LGTM
Created a resizable container tied to dragging state to create suitable droppable zone when there's no orphan favorites. Co-authored-by: Weiko <[email protected]>
Created a resizable container tied to dragging state to create suitable droppable zone when there's no orphan favorites.