Open oussamakhadraoui opened 2 weeks ago
Hello @oussamakhadraoui,
Thank you for taking the time to report this issue. The suggested performance optimizations donβt seem applicable, as the component needs to re-render if any of these values change. Even if they were, the performance gains are unlikely to be significant, so this is not a current priority for us.
We'll keep the issue open for further review and will assess it in due course.
Let us know if you disagree.
Is there an existing issue for this?
Current behavior
Sidebar Projects List Component Optimization
Current Behavior
The current sidebar projects list implementation (
SidebarProjectsListItem
) has several areas that could be optimized for better performance, maintainability, and user experience.Issues and Suggested Improvements
1. Performance Optimizations
isMenuActive
,isDragging
,isProjectListOpen
) that could trigger unnecessary re-renders. Consider consolidating these into a single state object.// Suggested const dragDropDeps = useMemo( () => ({ projectRef: projectRef?.current, dragHandle: dragHandleRef?.current, projectId, isLastChild, projectListType }), [projectRef?.current, dragHandleRef?.current, projectId, isLastChild, projectListType] );
3. Type Safety Improvements
4. Drag and Drop Logic
5. Mobile Experience
// Suggested const { isMobile, breakpoint } = useResponsive(); if (isMobile) { toggleSidebar(); }
Technical Implementation
Here's a suggested approach for the refactor:
Split Component:
Custom Hooks:
Testing Plan
Migration Strategy
Questions
Tasks
/label enhancement, performance /label documentation /milestone v2.0.0
Steps to reproduce
Just follow the instruction
Environment
Production
Browser
Google Chrome
Variant
Cloud
Version
last version