Overview
At Zepto, our internal operations and analytics dashboards are critical for real-time decision-making. These tools often present complex data, and empowering users to customize their workspace layout significantly boosts productivity. This problem challenges you to build a core component for such a dashboard, focusing on dynamic and nested resizable panels.
What you need to do / Task
Your goal is to implement a flexible panel layout system that allows users to resize different sections of a dashboard.
- Initial Layout Rendering: Render a predefined initial layout consisting of three distinct panels:
- A left column containing two panels stacked vertically:
Panel A (top) and Panel B (bottom).
- A right column containing a single panel:
Panel C.
- Initially, the left column (containing A and B) and the right column (C) should each occupy approximately 50% of the total dashboard width.
- Within the left column,
Panel A and Panel B should each occupy approximately 50% of the left column's height.
- Vertical Resizing: Implement a draggable vertical divider located between the left column (A+B) and the right column (C). Dragging this divider should dynamically adjust the widths of the two main columns while maintaining their total combined width.
- Horizontal Resizing: Implement a draggable horizontal divider located between
Panel A and Panel B within the left column. Dragging this divider should dynamically adjust the heights of Panel A and Panel B while maintaining the total height of the left column.
- Smooth Interaction: Ensure that resizing operations are smooth, visually responsive, and do not cause layout jumps or flickering.
- Panel Content: Each panel should display simple text content (e.g., "Analytics Chart", "Order List", "Recent Activity").
UI/UX expectations
- Visual Dividers: Clear, distinct visual dividers/handles should be present for both vertical and horizontal resizing. These should be visually distinct (e.g., using a background color or border).
- Cursor Feedback: The mouse cursor should change appropriately (e.g.,
ew-resize for vertical dividers, ns-resize for horizontal dividers) when hovering over a resizer.
- Responsive Resizing: Panel dimensions should update immediately as the user drags a divider, providing direct manipulation feedback.
- No Overflow: The overall dashboard container should not produce scrollbars due to resizing, and individual panel content should only scroll if its intrinsic content exceeds the panel's dimensions.
- Basic Styling: Panels should have visible borders and distinct background colors for easy differentiation.
Acceptance criteria
- The initial dashboard layout renders correctly with three distinct panels (A, B, C) in the specified configuration.
- The vertical divider is present and can be dragged to resize the left and right columns proportionally.
- The horizontal divider is present and can be dragged to resize
Panel A and Panel B proportionally.
- All resizing operations are smooth, without lag or visual artifacts.
- Panel content remains visible and contained within its respective panel during and after resizing.
- No console errors or warnings are observed during component rendering or user interaction.
- The solution effectively uses React state to manage panel dimensions.