[BUG] Division by zero panic in ResizablePanelGroup
Bug Report
Platform
All platforms (Linux, macOS, Windows, WSL2)
Current Behavior
In pps/desktop/src/components/resizable.rs:71-79, the drag fraction calculation divides by bounds width/height without checking for zero:
ust let fraction = match self.orientation { Orientation::Horizontal => { (event.event.position.x - bounds.left()) / (bounds.right() - bounds.left()) // Can be 0 } Orientation::Vertical => { (event.event.position.y - bounds.top()) / (bounds.bottom() - bounds.top()) // Can be 0 } };
If the panel group has zero width or height (e.g., during window initialization, minimized state, or layout edge cases), this causes a division by zero panic.
Expected Behavior
The calculation should guard against zero-size bounds and return a safe default fraction.
Steps To Reproduce
- Run the desktop app
- Resize window to minimum size or trigger a layout where panel bounds collapse to zero
- Attempt to drag the resizable handle
Recurrence Probability
Sometimes - depends on window state and layout timing
Additional Context
Critical bug - causes immediate panic/crash. Should be fixed before any PRs are accepted.
Source: OpenCut-app/OpenCut