#894·OpenCut

[BUG] Division by zero panic in ResizablePanelGroup

Author: rajpreetcodesCreated Aug 30, 2026Updated Sep 8, 2026

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

  1. Run the desktop app
  2. Resize window to minimum size or trigger a layout where panel bounds collapse to zero
  3. 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.